diff options
author | Aaron Ecay <aaronecay@gmail.com> | 2015-11-04 11:57:49 +0000 |
---|---|---|
committer | Aaron Ecay <aaronecay@gmail.com> | 2015-11-05 14:50:23 +0000 |
commit | e47c7c3ed624139d0982d1f408824be314a3c143 (patch) | |
tree | 319ee026437d254d0f8cde1d6e0065a725472cd3 | |
parent | 02c78501472fba94f8cf5a3d218b5c8845b28827 (diff) | |
download | org-mode-e47c7c3ed624139d0982d1f408824be314a3c143.tar.gz |
babel: update the manual wrt :cache header arg
* doc/org.texi (cache): Update manual section.
-rw-r--r-- | doc/org.texi | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/doc/org.texi b/doc/org.texi index ba402bf..c57cc41 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -16166,11 +16166,36 @@ used. The @code{:cache} header argument controls the use of in-buffer caching of the results of evaluating code blocks. It can be used to avoid re-evaluating -unchanged code blocks. Note that the @code{:cache} header argument will not -attempt to cache results when the @code{:session} header argument is used, -because the results of the code block execution may be stored in the session -outside of the Org mode buffer. The @code{:cache} header argument can have -one of two values: @code{yes} or @code{no}. +unchanged code blocks. When the cache is active, a source block is not +re-evaluated if a result for it is present in the buffer and neither the +header arguments (including the value of @code{:var} references) nor the text +of the block itself has changed since the result was computed. The feature +helps avoid re-running long calculations. However, there are edge cases and +you should not rely on the cache to behave reliably in all circumstances. + +The caching feature works best when a babel block is a pure function of its +arguments (@pxref{var}). That is, the function always returns the same +results when given the same arguments, and does not touch external resources +(like the filesystem or the languageās RNG) in any way.@footnote{The +documentation of the knitr reproducible research package for the R language +has some good discussion of issues that may arise when using the cache in +such a context. See @uref{http://yihui.name/knitr/demo/cache/}, especially +the sections ``Even more stuff for cache?'' and ``Reproducibility with RNG''. +(Obviously, you will have to abstract away from the knitr implementation +details which the documentation also discusses.)} + +Note that the @code{:cache} header argument will attempt to cache results +when the @code{:session} header argument is used, even though the results of +the code block execution stored in the session may lead to unexpected +results. + +Noweb references (@pxref{Noweb reference syntax}) are currently not expanded +when calculating whether the text of the code block has changed. Perhaps in +principle they ought to be, but this could introduce unexpected complexity. +See @uref{http://thread.gmane.org/gmane.emacs.orgmode/79046}. + +The @code{:cache} header argument can have one of two values: @code{yes} or +@code{no}. @itemize @bullet @item @code{no} |