Jambunathan K <kjambunat...@gmail.com> 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

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to