[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] babel: is it possible to cache #+call executed blocks
From: |
Eric Schulte |
Subject: |
Re: [O] babel: is it possible to cache #+call executed blocks |
Date: |
Fri, 03 Aug 2012 13:30:33 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
address@hidden (Arne Köhn) writes:
> address@hidden (Jonas Hörsch) writes:
>
>> i'm looking for a possibilty to call lengthy codeblocks a few times with
>> different parameters, but would like the results to be cached.
>
Use #+call lines with the :cache header argument set. With a recent
version of Org-mode the following should work as expected.
#+Title: An Example of Using the Cache Header Argument with Call Lines
A long running code block.
#+name: foo
#+begin_src emacs-lisp :var bar="baz"
(sit-for 5)
(message "bar=%S" bar)
#+end_src
#+RESULTS: foo
: bar="baz"
This returns immediately thanks to the cached result.
#+call: foo("qux") :cache yes
#+RESULTS[49bbb37e59694c557889ca8fd4b06fe0d4fb6b25]: foo("qux"):cache yes
: bar="qux"
This does not return immediately, because the block must execute.
#+call: foo("quxxx")
--
Eric Schulte
http://cs.unm.edu/~eschulte