Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Orgmode also has an amazing extension babel, which allows Literate Programming (or just inserting code snippets).

Using the #+BEGIN_SRC <mode-name> tag will also allow you to edit any code snippet in its own major mode.



Not working for me. What version of org-mode?


  #+begin_src lisp
  (defun botsbuildbots () (botsbuildbots))
  #+end_src
Try moving your point to (defun... and pressing << C-c ' >>. It should work with org-mode bundled in Emacs 23; if not, you can get the newest version from http://orgmode.org.

With org-babel enabled, you can actually run this code, or use it in literate-programming style to write programs.


One think that you can do in the latest orgmode, is to write code snippets in the org documents, extract the code, compile it (if needed, like for C code), run it, and insert the result back into the org document.

This is really nice for writing code example.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: