Erich Neuwirth <erich.neuwi...@univie.ac.at> 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]  
#+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}.
[2]  
,----
| commit 3dce21a0a4464463e1a518ae5b6ca5aef0dbc3c8
| Author: Nicolas Goaziou <n.goaz...@gmail.com>
| 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

Reply via email to