- publishing free software manuals
The Org Mode 7 Reference Manual
by Carsten Dominik and others
Paperback (6"x9"), 282 pages
ISBN 9781906966089
RRP £9.95 ($14.95)

Sales of this book support the Org project! Get a printed copy>>>

14.5 Evaluating code blocks

Code blocks can be evaluated(127) and the results placed in the Org-mode buffer. By default, evaluation is only turned on for emacs-lisp code blocks, however support exists for evaluating blocks in many languages. See section 14.7 Languages for a list of supported languages. See section 14.1 Structure of code blocks for information on the syntax used to define a code block.

There are a number of ways to evaluate code blocks. The simplest is to press C-c C-c or C-c C-v e with the point on a code block.(128) This will call the org-babel-execute-src-block function to evaluate the block and insert its results into the Org-mode buffer.

It is also possible to evaluate named code blocks from anywhere in an Org-mode buffer or an Org-mode table. #+call (or synonymously #+function or #+lob) lines can be used to remotely execute code blocks located in the current Org-mode buffer or in the “Library of Babel” (see section 14.6 Library of Babel). These lines use the following syntax.

#+call: <name>(<arguments>) <header arguments>
#+function: <name>(<arguments>) <header arguments>
#+lob: <name>(<arguments>) <header arguments>
The name of the code block to be evaluated.
Arguments specified in this section will be passed to the code block.
<header arguments>
Header arguments can be placed after the function invocation. See section 14.8 Header arguments for more information on header arguments.
ISBN 9781906966089The Org Mode 7 Reference ManualSee the print edition