emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] babel: is it possible to cache #+call executed blocks


From: Arne Köhn
Subject: Re: [O] babel: is it possible to cache #+call executed blocks
Date: Fri, 03 Aug 2012 18:04:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

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.

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

[Prev in Thread] Current Thread [Next in Thread]