A note about security: With code evaluation comes the risk of harm. Org safeguards by prompting for user's permission before executing any code in the source block. To customize this safeguard (or disable it) see Code evaluation security.
Org captures the results of the ‘src’ code block evaluation and inserts
them in the Org file, right after the ‘src’ code block. The insertion
point is after a newline and the
#+RESULTS label. Org creates the
#+RESULTS label if one is not already there.
By default, Org enables only
emacs-lisp ‘src’ code blocks for
execution. See Languages for identifiers to enable other languages.
Org provides many ways to execute ‘src’ code blocks. C-c C-c or
C-c C-v e with the point on a ‘src’ code block1 calls the
org-babel-execute-src-block function, which executes the code in the
block, collects the results, and inserts them in the buffer.
By calling a named code block2
from an Org mode buffer or a table. Org can call the named ‘src’ code
blocks from the current Org mode buffer or from the “Library of Babel”
(see Library of Babel). Whether inline syntax or the
syntax is used, the result is wrapped based on the variable
org-babel-inline-result-wrap, which by default is set to
to produce verbatim text suitable for markup.
The syntax for
#+CALL: <name>(<arguments>) #+CALL: <name>[<inside header arguments>](<arguments>) <end header arguments>
The syntax for inline named code block is
... call_<name>(<arguments>) ... ... call_<name>[<inside header arguments>](<arguments>)[<end header arguments>] ...
#+CALL:line that passes ‘4’ to a code block named
double, which declares the header argument
:var n=2, would be written as
#+CALL: double(n=4). Note how this function call syntax is different from the header argument syntax.
<inside header arguments>
[:results output]collects results printed to
STDOUTduring code execution of that block. Note how this header argument syntax is different from the function call syntax.
<end header arguments>
:results htmlwraps the results in a
BEGIN_EXPORT htmlblock before inserting the results in the Org buffer.
For more examples of header arguments for
see Arguments in function calls.
 The option
org-babel-no-eval-on-ctrl-c-ctrl-c can be used to remove code
evaluation from the C-c C-c key binding.