emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] How do I specify the language for a :results code block


From: Alan Schmitt
Subject: Re: [O] How do I specify the language for a :results code block
Date: Mon, 02 Dec 2013 14:04:40 +0100
User-agent: mu4e 0.9.9.6pre2; emacs 24.3.1

Hi Sébastien,

address@hidden writes:

>> Exporting if the result is not in the buffer is fine. I tried adding a
>> ":results replace" as inner header argument to the call line and to the
>> fetchcoq block, but it does not change anything.
>>
>> How can I tell the call line to replace the results when exporting?
>
> The syntax of the call line is:
>
>     #+call: <NAME>[<HEADER-ARGS-FOR-BLOCK>](<ARGUMENTS>) 
> <HEADER-ARGS-FOR-CALL-LINE>
>
> So, you should add your option either in [] after the name, or at the end of
> the line -- I'm always hesitating about where to put the right stuff (not so
> enough clear yet in my mind)...

I tried both, and neither works. Here is an org file showing the
problem:

--8<---------------cut here---------------start------------->8---
#+name: testcall
#+BEGIN_SRC sh :exports none :results raw
echo "#+BEGIN_SRC emacs-lisp"
echo "(+ 1 2)"
echo "#+END_SRC"
#+END_SRC

Test fails:
#+call: testcall() :results raw

#+RESULTS:
#+BEGIN_SRC emacs-lisp
(+ 1 2)
#+END_SRC

Test fails:
#+call: testcall[:results replace]() :results raw

#+RESULTS:
#+BEGIN_SRC emacs-lisp
(+ 1 2)
#+END_SRC

Test fails:
#+call: testcall() :results raw replace

#+RESULTS:
#+BEGIN_SRC emacs-lisp
(+ 1 2)
#+END_SRC

Test succeeds (results not already in the file):
#+call: testcall() :results raw
--8<---------------cut here---------------end--------------->8---

If you export this, you'll see that only the last call generates the
expected output.

Alan



reply via email to

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