From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giorgio Valoti Subject: Re: Re: Include files to be used in literate programming Date: Mon, 13 Sep 2010 17:17:52 +0200 Message-ID: References: <4A6B29B6-07EA-46F0-99E9-718F93DAE558@me.com> <87fwxdhktn.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=52674 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvAnC-00011d-7f for emacs-orgmode@gnu.org; Mon, 13 Sep 2010 11:18:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvAnA-0003fP-L0 for emacs-orgmode@gnu.org; Mon, 13 Sep 2010 11:18:02 -0400 Received: from asmtpout024.mac.com ([17.148.16.99]:52192) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvAnA-0003eg-Ff for emacs-orgmode@gnu.org; Mon, 13 Sep 2010 11:18:00 -0400 Received: from calcabrina.refactor.it (93-62-99-244.ip22.fastwebnet.it [93.62.99.244]) by asmtp024.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L8O00DYIYHTL690@asmtp024.mac.com> for emacs-orgmode@gnu.org; Mon, 13 Sep 2010 08:17:57 -0700 (PDT) In-reply-to: <87fwxdhktn.fsf@stats.ox.ac.uk> 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: emacs-orgmode@gnu.org Il giorno 13/set/2010, alle ore 14.47, Dan Davison ha scritto: > Giorgio Valoti writes: > [=85] >>=20 >> Is there a way to expand values from included files? >=20 > Hi Giorgio, >=20 > I don't know of a way currently but I agree that it is desirable. It > does seem temtping to want to use #+INCLUDE for this purpose; > however #+INCLUDE is an /export/ construct, and tangling is not > (technically at least) an Org-mode export method. Ah, here=92s why. > So some options that > come to my mind are: >=20 > 1. I am overlooking an existing way of doing this. >=20 > 2. Implement #+INCLUDE when tangling, optionally or by default. >=20 > 3. Implement a general way of including blocks of code from other = files > in such a way that they behave as 'normal' code blocks. This would > have several potentially useful consequences. What=92s the difference between options 2 and 3? I mean, if we #+INCLUDE = when tangling how is it different from including code blocks? Or do you = see option 3 as a more granular way to refer to external entities, = something comparable to a programming language import statement? >=20 > 4. It seems that it should be possible to get what you want by first > using `org-export-as-org' followed by `org-babel-tangle'. However, > `org-export-as-org' doesn't currently include #+INCLUDE'd files. I > wonder if it should. A hack to do what you want is below (You'll be > prompted for a file name to save the Org export buffer to.): Thank you, Dan. It could be a good enough interim solution. Ciao -- Giorgio Valoti