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: Alan Schmitt
Subject: Re: [O] How do I chain babel blocks with arguments?
Date: Fri, 18 Apr 2014 08:43:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin)

Hi Eric,

On 2014-04-17 07:42, Eric Schulte <address@hidden> writes:

> Alan Schmitt <address@hidden> writes:
>
>> How can I execute block `test1' from block `test2' by passing an
>> argument that is one from test2?
>>
>
> #+name: z
> : bar
> #+name: test1
> #+begin_src emacs-lisp :var x="foo"
> x
> #+end_src
>
> #+name:test2
> #+begin_src emacs-lisp :var y=test1(x=z)
> y
> #+end_src
> #+RESULTS: test2
> : bar

Thank you for the suggestion, but I'm afraid it does not do what I want:
I cannot pass a different argument 'z' to test2 (called test4 in the
following snippet):

--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")

#+results:
: "bar"
--8<---------------cut here---------------end--------------->8---

In this case, org-sbe works great, and I've been able to achieve what
I want. I still need to clean it up before describing it to the list.

Thanks again,

Alan



reply via email to

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