emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: [BABEL][PROPOSAL] headlines as executable srcnames


From: Eric Schulte
Subject: [Orgmode] Re: [BABEL][PROPOSAL] headlines as executable srcnames
Date: Sun, 19 Sep 2010 22:15:21 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Jambunathan K <address@hidden> writes:

[...]
>
> If headlines are considered as code blocks one actually inflate
> headlines and execute them for interesting side-effects.

Rather than create new syntax allowing headlines to be interpreted as
Org-mode code blocks, we could implement this ability of finding and
extending headlines into a code block through the library of babel.
This would allow headlines to be expanded easily and concisely from
inside of other code blocks without having to make any changes or
extensions to Babel.

So for example

#+source: headline
#+begin_src emacs-lisp :var headline=top :results org
  (org-open-link-from-string (org-make-link-string headline))
  (save-restriction
    (org-narrow-to-subtree)
    (buffer-string))
#+end_src

could then be called from inside of a code block to insert the body of a
headline in the same file, e.g.

#+begin_src org
  <<headline(headline="body")>>
#+end_src

This should be useful for easily including large portions of org-mode
files into code blocks for generating letters.

If this looks good, I'll add it to the library of babel so it's
universally available.

Best -- Eric



reply via email to

[Prev in Thread] Current Thread [Next in Thread]