A "functional-style" source block is one in which the name is followed
immediately by a parenthesised argument. An example is the following
"function", which generates n uniform random numbers:
\#+srcname: rand(n)
\#+begin_src R
runif(n)
\#+end_src
With these changes, such source blocks are passed over to the export
machinery in the following form:
\#+begin_src org-babel-lob
<function-def-keyword> rand(n):
\#+end_src
\#+begin_src R <switches>
<indent>runif(n)
\#+end_src
where <function-def-keyword> is the value of
org-babel-function-def-export-keyword, which defaults to "function",
<switches> are the src block switches that belonged to the original
block, and <indent> is the whitespace indent of the function body, the
width of which is determined by org-babel-function-def-export-indent.
org-babel-lob is a simple major mode responsible for fontification of
the blocks corresponding to the function definition line (as opposed
to the function body).
This forces the #+lob regexp to match at the beginning of a line (with
optional preceding whitespace), and requires inline code blocks to be
surrounded by some whitespace.
Currently, python fontification is used for export of these lines, due
to some similarity between python function call syntax and #+lob call
syntax. This is implemented as a language type "babel", mapped to
python in org-src-lang-modes.
merging original change by Dan Davison which generalizes the types
of blocks exported by org-babel to include the following types
- inline
- lob
- block
1) source blocks can now reference source-blocks in other files using
the filename:sourcename syntax
2) on export all references are now made to explicitly point to the
original buffer using the filename:sourcename syntax. This ensures
that all references are correctly resolved on export, even when the
referenced source block has already been processed.