emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] How do I chain babel blocks with arguments?


From: Eric Schulte
Subject: Re: [O] How do I chain babel blocks with arguments?
Date: Tue, 22 Apr 2014 07:30:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Alan Schmitt <address@hidden> writes:

> Hi Eric,
>
> On 2014-04-20 03:41, Eric Schulte <address@hidden> writes:
>
>>> --8<---------------cut here---------------start------------->8---
>>> #+name: z
>>> : "bar"
>>> #+name: test3
>>> #+begin_src emacs-lisp :var x="foo"
>>> x
>>> #+end_src
>>>
>>> #+name:test4
>>> #+begin_src emacs-lisp :var y=test1(x=z)
>>> y
>>> #+end_src
>>>
>>> #+results: test4
>>> : "bar"
>>>
>>> #+call: test4(z="BAZ")
>>                 ^
>> The above line has an error, your "z" should be an "x".
>
> I tried this change, and the argument is not taken into account:
>
> --8<---------------cut here---------------start------------->8---
> #+call: test4(x="BAZ")
>
> #+results:
> : "bar"
> --8<---------------cut here---------------end--------------->8---
>

Sorry, that's because the "x" should be "z".  See the following.

--8<---------------cut here---------------start------------->8---
#+name: z
: "bar"
#+name: test3
#+begin_src emacs-lisp :var x="foo"
x
#+end_src

#+RESULTS: test3
: foo

#+name:test4
#+begin_src emacs-lisp :var y=test3(x=z)
y
#+end_src

#+results: test4
: "bar"

#+call: test4(y="BAZ")

#+RESULTS:
: BAZ
--8<---------------cut here---------------end--------------->8---

>
> I'm not sure I mentioned it earlier, but I found a workaround using
> `org-sbe'.
>

Yes, I had noticed, but simple argument passing is also sufficient.

Best,

>
> Thanks,
>
> Alan

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



reply via email to

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