From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: babel: is it possible to cache #+call executed blocks Date: Fri, 03 Aug 2012 13:30:33 -0600 Message-ID: <874nojvkme.fsf@gmx.com> References: <87hatv4i9w.fsf@online.de> <87haskj724.fsf@meinschatz.hause> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxNaW-0003H7-Ev for emacs-orgmode@gnu.org; Fri, 03 Aug 2012 15:31:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SxNaV-0004dI-Ap for emacs-orgmode@gnu.org; Fri, 03 Aug 2012 15:31:08 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:40237) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SxNaV-0004d3-3Z for emacs-orgmode@gnu.org; Fri, 03 Aug 2012 15:31:07 -0400 In-Reply-To: <87haskj724.fsf@meinschatz.hause> ("Arne =?utf-8?Q?K=C3=B6hn?= =?utf-8?Q?=22's?= message of "Fri, 03 Aug 2012 18:04:19 +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: Arne =?utf-8?Q?K=C3=B6hn?= Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable arne@arne-koehn.de (Arne K=C3=B6hn) writes: > 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. > Use #+call lines with the :cache header argument set. With a recent version of Org-mode the following should work as expected. --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=call-cache.org #+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") --=-=-= Content-Type: text/plain -- Eric Schulte http://cs.unm.edu/~eschulte --=-=-=--