emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] tangle call lines


From: Andreas Leha
Subject: [O] tangle call lines
Date: Wed, 02 Apr 2014 09:51:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi all,

how do I go about to tangle a subtree full of call lines into a specific
file?  Of course, tangling is not execution and call lines are meant for
execution, but in a scripting language (this is all about R code) the
two are not too different.

Basically, I would love to see the code, that gets executed by
'org-babel-execute-subtree' to be saved to a given file.

Simply setting an tangle-file for the subtree does not work [fn:1].
(Which is not surprising...) 

But I guess I could use some pre-exec-hook together with some fine lisp
code to append the expanded call line code to a given file could do the
trick.

I'd be grateful for any help here.

Regards,
Andreas


Footnotes:

[fn:1] A simple example:
--8<---------------cut here---------------start------------->8---
#+PROPERTY: tangle test.R

I'd like to 'tangle' the 'Do all' subtree calls.  

* Do all
  :PROPERTIES:
  :tangle:   do_all.R
  :END:
#+call: src_b()
#+call: src_a()
#+call: src_c()

* Source
#+name: src_a
#+begin_src R
  a <- 10
#+end_src

#+name: src_b
#+begin_src R
  b <- 100
#+end_src

#+name: scr_c
#+begin_src R
  plot(a, b)
#+end_src
--8<---------------cut here---------------end--------------->8---





reply via email to

[Prev in Thread] Current Thread [Next in Thread]