From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: exporting, using names, and inline source code blocks Date: Sat, 15 Sep 2012 10:37:26 -0600 Message-ID: <87627fgs3d.fsf@gmx.com> References: <89D00423-64CB-4537-9C6E-698891BE21DA@univie.ac.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCvNE-0003fX-66 for emacs-orgmode@gnu.org; Sat, 15 Sep 2012 12:37:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCvNC-0007qE-Ok for emacs-orgmode@gnu.org; Sat, 15 Sep 2012 12:37:40 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:48074) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TCvNC-0007q0-Ht for emacs-orgmode@gnu.org; Sat, 15 Sep 2012 12:37:38 -0400 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: Erich Neuwirth Cc: Nicolas Goaziou , Org Mode Mailing List --=-=-= Content-Type: text/plain Erich Neuwirth writes: > I am using the latest version from ELPA, 20120903, OSX 10.8.1, and Emacs 24.2.1 > > The following document describes something which I perceive as strange behavior and a wish at the end. > There are a couple of things happening here. Some can be fixed by adjusting the syntax in your org-mode file. "elisp" should not be used, rather use "emacs-lisp" and your blocks will begin to be executed on export. Also, Emacs Lisp does not support sessions, so you may as well remove the session header arguments. And finally you *can* reference the result of a code block in an inline code block. See the attached [1] version of your example Org-mode file for specifics. You have also uncovered a bug in the export of inline code blocks introduced by the following recent commit [2]. I've just pushed up a new test case which exercises this bug, and which passes before this commit and fails afterwards. If you use the updated version of your example file, and either wait for a bug fix to be pushed, or use a version of Org-mode which pre-dates this commit you should get the export behavior you expect. Nicolas, I'm unable to take the time to fix this bug at the moment, however if you can address it, I suspect the following two items are relevant. 1. lack of preservation of whitespace around inline src blocks, related to the use of :begin at line 166 in ob-exp.el 2. incorrect position of the point before `org-babel-exp-do-export' is called at line 181 in ob-exp.el. Best, Footnotes: [1] --=-=-= Content-Type: text/x-org Content-Disposition: attachment; filename=it.org #+Title: Names test #+Options: ^:nil Define a named code block. #+name: namecode #+begin_src emacs-lisp :exports both 321 #+end_src The above *does* export the value. Technically a named value would be as follows. #+name: nameval : 456 Define a value in emacs-lisp #+begin_src emacs-lisp :exports both (setq lispval 123) #+end_src The above *does* export the value Inline evaluation of lispval equals src_emacs-lisp[:results raw]{lispval} The above *does* export the value. This should now work with both to LaTeX-pdf and to html. I would like a way which would allow me to use the value of the name =namecode= inline. You can do this with the following src_sh[:var it=namecode]{echo $it}. --=-=-= Content-Type: text/plain [2] ,---- | commit 3dce21a0a4464463e1a518ae5b6ca5aef0dbc3c8 | Author: Nicolas Goaziou | Date: Sun Aug 19 22:07:55 2012 +0200 | | Rewrite Babel pre-processing functions | | * lisp/ob-exp.el (org-babel-exp-src-block): Remove unused argument. | (org-babel-exp-non-block-elements): Rewrite function using Org Element. | * lisp/org-exp-blocks.el (org-export-blocks-preprocess): Rewrite | function using Org Element. `---- -- Eric Schulte http://cs.unm.edu/~eschulte --=-=-=--