From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sean O'Halpin" Subject: Re: How do I specify the language for a :results code block Date: Mon, 2 Dec 2013 18:09:55 +0000 Message-ID: References: <8661r7ze4y.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnXwZ-00035e-KC for emacs-orgmode@gnu.org; Mon, 02 Dec 2013 13:10:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnXwT-0006DT-Af for emacs-orgmode@gnu.org; Mon, 02 Dec 2013 13:10:03 -0500 Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]:49940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnXwT-0006D9-45 for emacs-orgmode@gnu.org; Mon, 02 Dec 2013 13:09:57 -0500 Received: by mail-we0-f175.google.com with SMTP id p61so12233742wes.20 for ; Mon, 02 Dec 2013 10:09:55 -0800 (PST) In-Reply-To: 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: Alan Schmitt Cc: Sebastien Vauban , Org Mode Hi, Taking a slightly different approach, you could use the :post header argument to wrap the results in a source block. See http://orgmode.org/org.html#post (from which the example below is deriv= ed). For example, you could use something like this: #+OPTIONS: d:RESULTS * Example #+name: eg-1 #+begin_src sh :results replace drawer :exports results :post wrap-src(text=3D*this*) head -n 3 demo.v #+end_src Output #+results: eg-1 * Utils :noexpo= rt: #+name: wrap-src #+begin_src emacs-lisp :var text=3D"" :results raw (concat "#+BEGIN_SRC coq\n" text "\n#+END_SRC") #+end_src BTW I answered a question similar to this on Stack Overflow recently (http://stackoverflow.com/questions/20194347/org-mode-with-code-example-as-= html/20232922#20232922) - must be something in the air. Regards, Sean On Mon, Dec 2, 2013 at 1:04 PM, Alan Schmitt wrote: > Hi S=E9bastien, > > sva-news@mygooglest.com 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: []() >> >> So, you should add your option either in [] after the name, or at the en= d of >> the line -- I'm always hesitating about where to put the right stuff (no= t 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 >