From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [BABEL] Tangling to a hierarchy of files? Date: Wed, 19 Jan 2011 13:06:49 +0100 Message-ID: <4D36D3D9.8080202@gmail.com> References: <87tyh5icir.fsf@gmail.com> <4D36B76D.9020502@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=48246 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfWoQ-0000q0-SO for emacs-orgmode@gnu.org; Wed, 19 Jan 2011 07:06:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfWoP-00031N-Bq for emacs-orgmode@gnu.org; Wed, 19 Jan 2011 07:06:54 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:48022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfWoP-00031H-6L for emacs-orgmode@gnu.org; Wed, 19 Jan 2011 07:06:53 -0500 Received: by wwb17 with SMTP id 17so781797wwb.30 for ; Wed, 19 Jan 2011 04:06:52 -0800 (PST) In-Reply-To: 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: Chris Maier Cc: emacs-orgmode@gnu.org, "Charles C. Berry" -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 01/19/2011 12:59 PM, Chris Maier wrote: > On Wed, Jan 19, 2011 at 5:05 AM, Rainer M Krug wrote: >> On 01/19/2011 08:22 AM, Eric Schulte wrote: >>> >>> In addition to the solution Charles posted, it is possible to put >>> arbitrary elisp forms into header arguments, so the following >>> alternative to your block above will create the directory (if it doesn't >>> already exist) whenever the block is tangled or evaluated. >>> >>> #+begin_src clojure :tangle (prog1 "src/foo.clj" (make-directory "src" ".")) >>> (ns foo) >>> >>> (defn my-inc [x] >>> (+ x 1)) >>> #+end_src > > This will do what I'm looking for, thanks! > > Is there a place where this and the eval-on-startup trick Charles > posted are documented? If so, I missed it, and these are both really > useful to know. > >> Would it be possible, to include this into tangling, i.e. if the folder >> in which the source file should be created does not exist, create it? >> >> I remember vaguely a discussion along these lines some time ago, but I >> don't remember the outcome? > > This would be a great feature to have. Eric's embedded Lisp code > trick will do the job, but I can imagine that it would get cumbersome > for more complex projects. Exactly - you effectively have to specify the same path twice - very error prone. Cheers, Rainer > > Thanks for all the help, everyone! > > Chris - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Tel: +33 - (0)9 53 10 27 44 Cell: +27 - (0)8 39 47 90 42 Fax (SA): +27 - (0)8 65 16 27 82 Fax (D) : +49 - (0)3 21 21 25 22 44 Fax (FR): +33 - (0)9 58 10 27 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0209kACgkQoYgNqgF2egpTuACeKw3OUQSA5x7ugyJe4syt0PkP pPgAnj77qMjWHKputXIn836nEclfsjg6 =mkG3 -----END PGP SIGNATURE-----