When exporting to html the source-code block name will be included
as a <label> immediately preceding the exported code. This <label>
is decorated with the 'org-src-name' css class.
When exporting to LaTeX with the listings package the source-code
block name will be included as a listings \title for the code
block. Currently the name will not be exported when the listings
package is not in use.
So, for example since the following <<example>> noweb reference
appears behind the SQL comment syntax the entire inserted body will
also be SQL commented
-- <<example>>
expands to
-- this is the
-- multi-line body of example
Note that noweb replacement text which does *not* contain any
newlines will not be affected by this change, so it is still
possible to use inline noweb references.
Thanks to Sébastien Vauban for this idea.
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'