* tangle call lines
@ 2014-04-02 7:51 Andreas Leha
2014-04-04 8:39 ` Sebastien Vauban
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Leha @ 2014-04-02 7:51 UTC (permalink / raw)
To: emacs-orgmode
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---
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: tangle call lines
2014-04-02 7:51 tangle call lines Andreas Leha
@ 2014-04-04 8:39 ` Sebastien Vauban
0 siblings, 0 replies; 2+ messages in thread
From: Sebastien Vauban @ 2014-04-04 8:39 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Andreas Leha wrote:
> 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.
Could you restate your objectives if I did not understand? What do you
wanna save in a file: code, or code + results?
If the former, what about using Noweb syntax (<<block>> or even
<<block()>>)?
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-04 8:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-02 7:51 tangle call lines Andreas Leha
2014-04-04 8:39 ` Sebastien Vauban
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).