From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] Trouble with :cache yes Date: Wed, 23 Mar 2011 12:16:38 -0600 Message-ID: <87pqphd7nd.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=60126 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2Sby-0001am-65 for emacs-orgmode@gnu.org; Wed, 23 Mar 2011 14:16:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2Sbw-0004Ro-IP for emacs-orgmode@gnu.org; Wed, 23 Mar 2011 14:16:50 -0400 Received: from mail-gy0-f169.google.com ([209.85.160.169]:50082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2Sbw-0004Re-B6 for emacs-orgmode@gnu.org; Wed, 23 Mar 2011 14:16:48 -0400 Received: by gyg10 with SMTP id 10so3747150gyg.0 for ; Wed, 23 Mar 2011 11:16:47 -0700 (PDT) In-Reply-To: (Ken Williams's message of "Wed, 23 Mar 2011 13:05:40 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ken.Williams@thomsonreuters.com Cc: emacs-orgmode@gnu.org, r.m.krug@gmail.com writes: > On 3/23/11 12:54 PM, "Williams, Ken (TR Corp Tech)" > wrote: > >> >>On 3/23/11 12:28 PM, "Eric Schulte" wrote: >> >>>Thanks for pointing this out, your example doesn't work for me either. >>>I tracked this down to a problem of not finding the cached results of >>>named code blocks. I've just pushed up a simple fix for this issue, so >>>caching should now work as expected. >> >>Thanks Eric. In my case I'm seeing the [mis]behavior even when the code >>block has no name - will your fix cover that case too? > > Actually, I just realized I'm mistaken. If I manually evaluate a > (non-named) block, *then* export the entire document, I indeed get the > cached results in the export, as expected. > > However, if I change the code of a :cached block somewhere in my document > (or its MD5 is otherwise invalidated) and re-export the document without > first doing C-c C-c, the export will neither use the cache (which is good) > nor save the results back to the cache (which is bad), so the export is > now out of sync with the original. It would be great if the results in > exports could be cached in the same way they would be cached when manually > evaluating blocks. > One of the features of Org-mode export is that the document is not changed by the act of exporting, so unfortunately you will have to manually evaluate all code blocks, and save their results before exporting. > > Or perhaps, is there some command to evaluate all blocks in a document > that need to be re-evaluated, and save the results back to the buffer? I > could do that every time before exporting, maybe. > Fortunately there is such a function, org-babel-execute-buffer, bound to C-c C-v b, try C-c C-v h in an Org-mode buffer to see all code block specific key bindings. Best -- Eric > > > -- > Ken Williams > Senior Research Scientist > Thomson Reuters > http://labs.thomsonreuters.com