From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [BABEL][PROPOSAL] headlines as executable srcnames Date: Sun, 19 Sep 2010 22:15:21 -0600 Message-ID: <87lj6xcap2.fsf@gmail.com> References: <87zkvtn5u7.fsf@mundaneum.com> <81wrqxv1bq.fsf@gmail.com> <87r5h5gwxo.fsf@mundaneum.com> <87iq2huk7u.fsf@gmail.com> <81lj7cyhkq.fsf@gmail.com> <87lj7cz1lh.fsf@gmail.com> <817hiwqk6c.fsf_-_@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=50984 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OxXmp-0000QH-Dz for emacs-orgmode@gnu.org; Mon, 20 Sep 2010 00:15:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OxXmo-0003rW-4J for emacs-orgmode@gnu.org; Mon, 20 Sep 2010 00:15:27 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:59893) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OxXmo-0003rN-0a for emacs-orgmode@gnu.org; Mon, 20 Sep 2010 00:15:26 -0400 Received: by iwn33 with SMTP id 33so6386110iwn.0 for ; Sun, 19 Sep 2010 21:15:25 -0700 (PDT) In-Reply-To: <817hiwqk6c.fsf_-_@gmail.com> (Jambunathan K.'s message of "Wed, 08 Sep 2010 21:52:51 +0530") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Jambunathan K Cc: emacs-orgmode@gnu.org Jambunathan K 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 <> #+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