emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ivanov Dmitry <usr345@gmail.com>
To: "Jan Böcker" <jan.boecker@jboecker.de>
Cc: emacs-orgmode@gnu.org
Subject: Re[2]: Literate programming
Date: Tue, 11 May 2010 11:22:56 +0400	[thread overview]
Message-ID: <236908404.20100511112256@gmail.com> (raw)
In-Reply-To: <4BE8F13F.9030309@jboecker.de>

> 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.

      parent reply	other threads:[~2010-05-11  8:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07 14:09 Literate programming Ivanov Dmitry
2010-05-07 21:02 ` Eric Schulte
2010-05-11  5:55   ` Jan Böcker
2010-05-11  7:09     ` Carsten Dominik
2010-05-11  7:22     ` Ivanov Dmitry [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=236908404.20100511112256@gmail.com \
    --to=usr345@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jan.boecker@jboecker.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).