From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: tangle call lines Date: Wed, 02 Apr 2014 09:51:57 +0200 Message-ID: <877g78gode.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVhrc-00077M-6R for emacs-orgmode@gnu.org; Thu, 03 Apr 2014 09:39:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVhrR-0001zi-Ro for emacs-orgmode@gnu.org; Thu, 03 Apr 2014 09:39:28 -0400 Received: from plane.gmane.org ([80.91.229.3]:41099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVhrR-0001zZ-K1 for emacs-orgmode@gnu.org; Thu, 03 Apr 2014 09:39:17 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WVh8K-0002Sk-0I for emacs-orgmode@gnu.org; Thu, 03 Apr 2014 14:52:40 +0200 Received: from genepi110.genepi.med.uni-goettingen.de ([134.76.140.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Apr 2014 14:52:39 +0200 Received: from andreas.leha by genepi110.genepi.med.uni-goettingen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Apr 2014 14:52:39 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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---