co...@online.de (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.

It's probably a bit late, but I stumbled over the same problem. Here is
how I dealt with it (it's not that pretty).

Instead of

,----
|  #+call foofunc(bar=baz)
`----

I wrote a emacs-lisp block doing the same:

,----
| #+name: speak_world
| #+begin_src emacs-lisp :cache yes
|   (save-excursion
|     (goto-char (org-babel-find-named-block "speak"))
|     (org-babel-execute-src-block nil nil '((:var "say=world")))
|   )
| #+end_src
`----

In contrast to #+call, this results in a cached result for foo_bar that
can be accessed later on.

The disadvantages:
 - the cached result will never be invalidated (since foo_bar doesn't
   change)
 - somehow the variable bar will not be "baz" but "baz=", I changed my
   code block to strip the trailing "=".

If someone could point out where this "=" comes from: please tell me!


Arne

Reply via email to