From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Berry Subject: Re: How do I chain babel blocks with arguments? Date: Wed, 16 Apr 2014 20:49:43 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaWmP-0004A6-NC for emacs-orgmode@gnu.org; Wed, 16 Apr 2014 16:50:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WaWmJ-0006MB-Lw for emacs-orgmode@gnu.org; Wed, 16 Apr 2014 16:50:01 -0400 Received: from plane.gmane.org ([80.91.229.3]:53353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaWmJ-0006M3-Eu for emacs-orgmode@gnu.org; Wed, 16 Apr 2014 16:49:55 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WaWmH-0001Nw-SY for emacs-orgmode@gnu.org; Wed, 16 Apr 2014 22:49:53 +0200 Received: from 172-7-166-26.lightspeed.sndgca.sbcglobal.net ([172.7.166.26]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Apr 2014 22:49:53 +0200 Received: from ccberry by 172-7-166-26.lightspeed.sndgca.sbcglobal.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Apr 2014 22:49:53 +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 Alan Schmitt polytechnique.org> writes: > > Hello, > > I have several babel blocks that each work well, but I'm now trying to > chain them to build some bigger functionality out of them. I'm having > trouble finding out how to pass arguments between blocks. Here is > a small example: > > --8<---------------cut here---------------start------------->8--- > #+name: test1 > #+begin_src emacs-lisp :var x="foo" > x > #+end_src > > #+name:test2 > #+begin_src emacs-lisp :var z="bar" :var y=test1(x=z) > y > #+end_src > > #+call: test2(z="baz") > --8<---------------cut here---------------end--------------->8--- > > Unfortunately this does not work: the evaluation of block `test2' fails > by telling me `z' does not exist. > > How can I execute block `test1' from block `test2' by passing an > argument that is one from test2? This is not pretty, but it works: #+name:test2 #+begin_src emacs-lisp :var z="bar" (let ((y (org-sbe test1 (x (intern z))))) y) #+end_src HTH, Chuck