From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Berry Subject: Re: How do I specify the language for a :results code block Date: Fri, 29 Nov 2013 23:48:51 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmXoI-0007XF-L9 for emacs-orgmode@gnu.org; Fri, 29 Nov 2013 18:49:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VmXoA-0004De-IJ for emacs-orgmode@gnu.org; Fri, 29 Nov 2013 18:49:22 -0500 Received: from plane.gmane.org ([80.91.229.3]:39332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmXoA-0004Cy-Bk for emacs-orgmode@gnu.org; Fri, 29 Nov 2013 18:49:14 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VmXo7-0002RC-Bz for emacs-orgmode@gnu.org; Sat, 30 Nov 2013 00:49:11 +0100 Received: from 137.110.38.30 ([137.110.38.30]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 30 Nov 2013 00:49:11 +0100 Received: from ccberry by 137.110.38.30 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 30 Nov 2013 00:49:11 +0100 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: emacs-orgmode@gnu.org Thomas S. Dye tsdye.com> writes: > > Aloha Alan, > > Alan Schmitt polytechnique.org> writes: > > > Hello, > > > > I'm trying to write a block in some language (right now shell, but it > > will probably be something different) whose output is an org source > > block is some language (here coq). I keep looking at the documentation > > and I cannot see how to specify the language. If I try something like: [example-deleted] > > > > How can I have a block with "#+BEGIN_SRC coq" instead? [snip] > > I think this can be accomplished by chaining: > [example-deleted] The problem I see is that the :var x=y() idiom can hand an object to the src block that is hard to parse and execute -- depending on the language. If the object is create code in one language and run it in another, it is sometimes easier to insert results using noweb <> calls. A simple example: generate code in sh that is run in emacs-lisp #+name: make-elisp #+BEGIN_SRC sh :exports none :var fun="+" echo "(" $fun "1 2)" #+END_SRC #+BEGIN_SRC emacs-lisp :noweb yes :exports results <> #+END_SRC #+RESULTS: : 3 #+BEGIN_SRC emacs-lisp :noweb yes :exports results <> #+END_SRC #+RESULTS: : -1 #+BEGIN_SRC emacs-lisp :noweb yes :exports results <> #+END_SRC #+RESULTS: | 1 | 2 | HTH, Chuck