outorg Lets You Convert Source-Code Buffers Temporarily To Org-Mode For Comment Editing

outorg lets you convert source-code buffers temporarily to org-mode for comment editing.

Outorg is for editing comment-sections of source-code files in temporary Org-mode buffers. It turns conventional literate-programming upside-down in that the default mode is the programming-mode, and special action has to be taken to switch to the text-mode (i.e. Org-mode).

Outorg depends on Outshine, i.e. outline-minor-mode with outshine extensions activated. An outshine buffer is structured like an org-mode buffer, only with outcommented headlines. While in Org-mode text is text and source-code is ’hidden’ inside of special src-blocks, in an outshine buffer source-code is source-code and text is ’hidden’ as comments.

Thus org-mode and programming-mode are just two different views on the outshine-style structured source-file, and outorg is the tool to switch between these two views. When switching from a programming-mode to org-mode, the comments are converted to text and the source-code is put into src-blocks. When switching back from org-mode to the programming-mode, the process is reversed – the text is outcommented again and the src-blocks that enclose the source-code are removed.

When the code is more important than the text, i.e. when the task is rather ’literate PROGRAMMING’ than ’LITERATE programming’, it is often more convenient to work in a programming-mode and switch to org-mode once in a while than vice-versa. Outorg is really fast, even big files with 10k lines are converted in a second or so, and the user decides if he wants to convert just the current subtree (done instantly) or the whole buffer. Since text needs no session handling or variable passing or other special treatment, the outorg approach is much simpler than the Org-Babel approach. However, the full power of Org-Babel is available once the outorg-edit-buffer has popped up.

Intriguing!

3 thoughts on “outorg Lets You Convert Source-Code Buffers Temporarily To Org-Mode For Comment Editing”

Leave a Reply

Your email address will not be published. Required fields are marked *