alain.coch...@unistra.fr writes:

> Org evaluates source code blocks in an Org file during export.

I have just tried to export the following document:

#+begin_src emacs-lisp :exports both
(+ 1 1)
#+end_src

The exported HTML file contains the expression '(+ 1 1)' along with '2',
its value.  It follows that Emacs does evaluate source blocks on export.

(Note that Org did not add RESULTS to the Org file during export, for no
export should ever modify the source file in any way.)

> why does '#+RESULTS:' show 'bar' and not 'foo'?

By default, the Org mode captures the value of the last expression.  In
your case, the last expression has the value of 'bar'.

If you want to capture something else for the result, such as standard
output, you must tell Org Babel about it with the ':results' argument.
It makes sense, if you think about it.  The computer cannot possibly
know what you want to capture.

Rudy
-- 
"The introduction of suitable abstractions is our only mental aid to
organize and master complexity."
-- Edsger Wybe Dijkstra, 1930-2002

Rudolf Adamkovič <salu...@me.com> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia

Reply via email to