[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re[2]: [Orgmode] Literate programming
From: |
Ivanov Dmitry |
Subject: |
Re[2]: [Orgmode] Literate programming |
Date: |
Tue, 11 May 2010 11:22:56 +0400 |
> What is this "tree buffer" you speak of?
The tree buffer is a library from CEDET project, widely used in ECB. Look at
this screenshot, and you'll see tree buffers at the top of the frame:
http://ecb.sourceforge.net/screenshots/12.png
> Are you telling me that I can already use Org to view the outline
> Leo-style, with the outline structure (folded to the "content" startup
> visibility) in one window and an indirect buffer narrowed to the body
> text of the current headline in a second window?
I did it with org-babel. Install it, using this manual:
http://orgmode.org/worg/org-contrib/babel/intro.php
then you can try treir sample, that I rewrote in Perl:
* Prefix
Here we have the code, that is output in the beginning of the file
#+srcname: hello-world-prefix
#+begin_src perl
print "/-----------------------------------------------------------\\\n";
#+end_src
* Postfix
This code will be used at the end of the file.
#+srcname: hello-world-postfix
#+begin_src perl
print "\-----------------------------------------------------------/";
#+end_src
* File body
This is the main code of the file.
#+srcname: hello-world
#+begin_src perl :tangle hello.pl
<<hello-world-prefix>>
print "| hello world |\n";
<<hello-world-postfix>>
#+end_src
---------end sample---------------------
You can edit the code in an indirect buffer, using C-c '. Tangle it with
(org-babel-tangle).
> That would be wonderful! (If not, I would definitely be interested in
> creating such a feature, but I have no idea where to start.)
The first step will be understanding, how does the CEDET library tree-buffer.el
work.