[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: |
Sat, 30 Nov 2013 06:57:52 -1000 |
Alan Schmitt <address@hidden> writes:
> I tried this alternate approach, to directly generate the block:
>
> #+name: fetchcoq2
> #+BEGIN_SRC sh :exports none :results raw :var f="demo.v"
> echo "#+BEGIN_SRC coq"
> head $f
> echo
> echo "#+END_SRC"
> #+END_SRC
>
> #+call: fetchcoq2("demo.v")
>
> But then I get a result like this, with extra quoting:
>
> #+RESULTS:
> : #+BEGIN_SRC coq
> : Definition toto : forall x, exists y, x = y.
> :
> : Lemma foo: forall x, x=x.
> : #+END_SRC
>
> I feel like I'm missing something obvious. ":results code" is exactly
> what I want (put the results in a SRC block), but I don't know how to
> specify the headers of the generated code block.
You need :results raw at the end of the call line.
#+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
#+call: fetchcoq2("demo.v") :results raw
#+results:
#+BEGIN_SRC coq
demo.v
#+END_SRC
hth,
Tom
--
Thomas S. Dye
http://www.tsdye.com