emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Ken.Williams@thomsonreuters.com
Cc: emacs-orgmode@gnu.org, r.m.krug@gmail.com
Subject: Re: [babel] Trouble with :cache yes
Date: Wed, 23 Mar 2011 12:16:38 -0600	[thread overview]
Message-ID: <87pqphd7nd.fsf@gmail.com> (raw)
In-Reply-To: <C9AF9E97.285D7%ken.williams@thomsonreuters.com> (Ken Williams's message of "Wed, 23 Mar 2011 13:05:40 -0500")

<Ken.Williams@thomsonreuters.com> writes:

> On 3/23/11 12:54 PM, "Williams, Ken (TR Corp Tech)"
> <Ken.Williams@thomsonreuters.com> wrote:
>
>>
>>On 3/23/11 12:28 PM, "Eric Schulte" <schulte.eric@gmail.com> 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

  reply	other threads:[~2011-03-23 18:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 15:29 [babel] Trouble with :cache yes Ken.Williams
2011-03-23  2:50 ` Eric Schulte
2011-03-23  6:46   ` Rainer M Krug
2011-03-23 16:00     ` Ken.Williams
2011-03-23 17:46       ` Eric Schulte
2011-03-23 17:28     ` Eric Schulte
2011-03-23 17:54       ` Ken.Williams
2011-03-23 18:03         ` Eric Schulte
2011-03-23 18:05         ` Ken.Williams
2011-03-23 18:16           ` Eric Schulte [this message]
2011-03-23 21:55             ` Ken.Williams
2011-03-23 22:00               ` Erik Iverson
2011-03-23 22:12                 ` Ken.Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pqphd7nd.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=Ken.Williams@thomsonreuters.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=r.m.krug@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).