On Wed, Jan 19, 2011 at 5:05 AM, Rainer M Krug <r.m.k...@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.

Thanks for all the help, everyone!

Chris

_______________________________________________
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