emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: tangle call lines
Date: Wed, 02 Apr 2014 09:51:57 +0200	[thread overview]
Message-ID: <877g78gode.fsf@med.uni-goettingen.de> (raw)

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	other threads:[~2014-04-03 13:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02  7:51 Andreas Leha [this message]
2014-04-04  8:39 ` tangle call lines Sebastien Vauban

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=877g78gode.fsf@med.uni-goettingen.de \
    --to=andreas.leha@med.uni-goettingen.de \
    --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).