From mboxrd@z Thu Jan 1 00:00:00 1970 From: arne@arne-koehn.de (Arne =?utf-8?Q?K=C3=B6hn?=) Subject: Re: babel: is it possible to cache #+call executed blocks Date: Fri, 03 Aug 2012 18:04:19 +0200 Message-ID: <87haskj724.fsf@meinschatz.hause> References: <87hatv4i9w.fsf@online.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxKMd-0003v6-5k for emacs-orgmode@gnu.org; Fri, 03 Aug 2012 12:04:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SxKMc-0006Pc-26 for emacs-orgmode@gnu.org; Fri, 03 Aug 2012 12:04:35 -0400 Received: from mailhost.informatik.uni-hamburg.de ([134.100.9.70]:40000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxKMb-0006PN-RO for emacs-orgmode@gnu.org; Fri, 03 Aug 2012 12:04:33 -0400 Received: from localhost (localhost [127.0.0.1]) by mailhost.informatik.uni-hamburg.de (Postfix) with ESMTP id B66057D1 for ; Fri, 3 Aug 2012 18:04:30 +0200 (CEST) Received: from mailhost.informatik.uni-hamburg.de ([127.0.0.1]) by localhost (mailhost.informatik.uni-hamburg.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id J-GD3rHHVL-l for ; Fri, 3 Aug 2012 18:04:30 +0200 (CEST) Received: from meinschatz.hause (fbipc04156.informatik.uni-hamburg.de [134.100.4.156]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) (Authenticated sender: 5koehn) by mailhost.informatik.uni-hamburg.de (Postfix) with ESMTPSA id 244237D0 for ; Fri, 3 Aug 2012 18:04:19 +0200 (CEST) In-Reply-To: <87hatv4i9w.fsf@online.de> ("Jonas \=\?utf-8\?Q\?H\=C3\=B6rsch\=22's\?\= message of "Thu, 28 Jun 2012 16:34:35 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org coroa@online.de (Jonas H=C3=B6rsch) 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=3Dbaz) `---- 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=3Dworld"))) | ) | #+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=3D", I changed my code block to strip the trailing "=3D". If someone could point out where this "=3D" comes from: please tell me! Arne