Variable names in gnuplot source code preceded by the '$' character
will be expanded to their value before the code is executed. For
example the following will results in the evaluation of 'plot
sin(x)' by gnuplot.
"sin(x)"
plot $fun
Insertion of new results was failing if the block was followed by
end-of-buffer. Also, if the block was followed by non-empty lines, the
\#+resname was being inserted away from column 0.
pressing tab while on the front of a results line will fold the
results in the same manner as tabbing on the front of a block will
fold the block. To automatically hide all blocks when entering a
new file add the `org-babel-result-hide-all' function to your
`org-mode-hook'
"results" is now an acceptable alias for "resname". Org-babel
will begin inserting results using the "results" option however
either option will remain viable moving forward.
The initial `org-babel-hash-show' characters of the hash will
remain visible. Pressing C-c C-c with the point on one of these
initial characters will copy the hash to the kill ring, should you
need to know it for any particular reason.
This can be overridden with the use of the header argument :cache on
the block, or subtree level. To set the global behavior to caching
add the following to your emacs init
(setq org-babel-default-header-args
(delete '(:nocache) org-babel-default-header-args))
This commit expands the #+resname: line to include a sha1 hash of
the contents of the source-code block (including header arguments).
This hash is saved in raw text in the resname line. When a source
block is evaluated it's hash is recalculated and checked against the
hash in it's results line, if they are equal the current results are
returned with no recalculation.
Optional prefix argument when evaluating a source block will force
re-calculation.
caching behavior can be inhibited through the use of the :nocache
header argument. for global inhibition of caching add :nocache to
the `org-babel-default-header-args' variable.
it is now possible to only assign a portion of a value to a variable
in a source block. So for example the following will only assign
the second and third lines of the table 'example-table' to the
variable 'data'
:var data=example-table[1:2]
and the following will only assign the second column of the first row
:var data=example-table[0,1]
note that all indices are 0 based
it is possible to index into the results of source-code blocks as
well as tables. any number of dimensions can be indexed as long as
they are separated by ','s and ranges can be indexed using the ':'
operator. for more information on indexing behavior see
`org-babel-ref-index-list'
With this change, if :file <filepath> is specified, ruby and python
blindly output a link to <filepath>. Responsibility for creating the
contents in <filepath> lies with the python/ruby code.
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 adds a new terminal (sixth) element to the list returned from
org-babel-get-src-block-info. It is used when exporting the code of
"functional style" code blocks, i.e. those in which the name of the
block is followed by a parenthesised argument list (or an empty pair
of parentheses).