emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <r.m.krug@gmail.com>
To: Chris Maier <christopher.maier@gmail.com>
Cc: emacs-orgmode@gnu.org, "Charles C. Berry" <cberry@tajo.ucsd.edu>
Subject: Re: [BABEL] Tangling to a hierarchy of files?
Date: Wed, 19 Jan 2011 13:06:49 +0100	[thread overview]
Message-ID: <4D36D3D9.8080202@gmail.com> (raw)
In-Reply-To: <AANLkTinvb9F2LGfpiy9RnPB8gBkEGQxL3RpkHXYcWkxs@mail.gmail.com>

-----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 <r.m.krug@gmail.com> 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-----

  reply	other threads:[~2011-01-19 12:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-19  4:02 [BABEL] Tangling to a hierarchy of files? Christopher Maier
2011-01-19  6:45 ` Charles C. Berry
2011-01-19  7:22   ` Eric Schulte
2011-01-19 10:05     ` Rainer M Krug
2011-01-19 11:59       ` Chris Maier
2011-01-19 12:06         ` Rainer M Krug [this message]
2011-01-19 16:20         ` Charles C. Berry
2011-01-19 16:27           ` Chris Maier
2011-01-19 17:41         ` Eric Schulte
2011-01-19 18:18           ` Chris Maier
2011-01-20  3:37             ` Eric Schulte
2011-01-20 10:06               ` Rainer M Krug
2011-01-21  2:11               ` Chris Maier
2011-01-20  9:09           ` Christopher Witte
2011-01-20 16:11             ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D36D3D9.8080202@gmail.com \
    --to=r.m.krug@gmail.com \
    --cc=cberry@tajo.ucsd.edu \
    --cc=christopher.maier@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).