emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org babel and alternative output file when using +call
@ 2010-10-27 14:38 Henning Redestig
  2010-10-27 16:20 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Henning Redestig @ 2010-10-27 14:38 UTC (permalink / raw)
  To: emacs-orgmode

Dear list,

When I do

#+source: test(myarg="blabla")
#+begin_src R :session :file test.pdf
  plot(1:10, main=myarg)
#+end_src

I get the expected result:

#+results: test
[[file:test.pdf]]

but if I later do

#+call: test(myarg="hiho") :file test2.pdf

I still get a file named according to the header argument specified in
the original source block:

#+results: test(myarg="hiho")
[[file:test.pdf]]

instead of what I hoped for:

#+results: test(myarg="hiho")
[[file:test2.pdf]]

Is this intended? I think it would be very useful if I could change
the file name in '+calls' like this to get different plots for
different arguments.

Using:

GNU Emacs 23.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.18.0) of
2009-09-27 on crested, modified by Debian
Org-mode version 7.01trans

Best regards,

-- 
/Henning Redestig

Metabolome Informatics Unit | Yokohama RIKEN Plant Science Center

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: org babel and alternative output file when using +call
  2010-10-27 14:38 org babel and alternative output file when using +call Henning Redestig
@ 2010-10-27 16:20 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2010-10-27 16:20 UTC (permalink / raw)
  To: Henning Redestig; +Cc: emacs-orgmode

Hi Henning,

This is a limitation of the current #+call: line syntax.  The header
arguments you are passing at the end of the call line are being applied
to the call line, not to the original R code block.  This has come up
before and the proposed solution is to allow passing arguments directly
through to the called code block, using a syntax like

#+call: eight[:session *R*]() :results vector

in which case the ":results vector" header argument is applied to the
call line, and the ":session *R*" header argument is passed through to
the called R code block (in the above case named "eight").

So, while what you want is not currently possible, it should be so in
the future, it's just a question of when...

Best -- Eric

Henning Redestig <henning.red@googlemail.com> writes:

> Dear list,
>
> When I do
>
> #+source: test(myarg="blabla")
> #+begin_src R :session :file test.pdf
>   plot(1:10, main=myarg)
> #+end_src
>
> I get the expected result:
>
> #+results: test
> [[file:test.pdf]]
>
> but if I later do
>
> #+call: test(myarg="hiho") :file test2.pdf
>
> I still get a file named according to the header argument specified in
> the original source block:
>
> #+results: test(myarg="hiho")
> [[file:test.pdf]]
>
> instead of what I hoped for:
>
> #+results: test(myarg="hiho")
> [[file:test2.pdf]]
>
> Is this intended? I think it would be very useful if I could change
> the file name in '+calls' like this to get different plots for
> different arguments.
>
> Using:
>
> GNU Emacs 23.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.18.0) of
> 2009-09-27 on crested, modified by Debian
> Org-mode version 7.01trans
>
> Best regards,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-27 16:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-27 14:38 org babel and alternative output file when using +call Henning Redestig
2010-10-27 16:20 ` Eric Schulte

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