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: Thomas S. Dye
Subject: Re: [O] How do I specify the language for a :results code block
Date: Mon, 02 Dec 2013 06:53:25 -1000

Aloha Alan,

Alan Schmitt <address@hidden> writes:

> Unfortunately, if I export this, the code is duplicated. Here is the
> generated html, for instance:

Yes, the code is partially duplicated when I run it. It looks to me as
if the problem stems from :results raw and the fact that results is
itself a source code block that includes lines like #+BEGIN_SRC and
#+END_SRC.

Perhaps the same confusion shows if you change the :results raw header
argument for the call line to :results org, evaluate, change back to
:results raw, and then evaluate again. You should find an extra
#+END_SRC in the buffer.

IIUC, your goal is to export the coq source code blocks. Does the
following, which uses :results org, do what you want? It seems to work
for me.

#+name: fetchcoq2
#+BEGIN_SRC sh :exports none :results raw :var f="demo.v"
echo "#+BEGIN_SRC coq"
echo $f
echo "#+END_SRC"
#+END_SRC

#+results: fetchcoq2
#+BEGIN_SRC coq
demo.v
#+END_SRC

#+name: fetchcoq-call
#+call: fetchcoq2("demo.v") :results org

#+results: fetchcoq-call
#+BEGIN_SRC org
,#+BEGIN_SRC coq
demo.v
,#+END_SRC
#+END_SRC

hth,
Tom

P.S. I remembered :wrap just now. This doesn't export well, though.

#+call: fetchcoq2("demo.v") :wrap src coq

#+results:
#+BEGIN_src coq
demo.v
#+END_src

Tom

-- 
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com



reply via email to

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