emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Get =#+RESULTS= without re-evaluating source code block?
Date: Tue, 02 Feb 2021 15:02:08 -0500	[thread overview]
Message-ID: <875z3az1a7.fsf@alphaville.usersys.redhat.com> (raw)
In-Reply-To: m28s87i5i8.fsf@andrew.cmu.edu

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> I discovered that it matters a lot which block you cache. You have to
> cache the long running block. I had put cache on the block with noweb
> expansion, and then the long running block still runs every time. That
> was a surprise to me, since nothing was changing in that block, so I
> thought it would just use the cached result.
>

Just to elaborate a bit: Org mode checks whether to reevaluate a cached block
by checksumming it and seeing if the sum is different from before. That's why
you have to mark the actual block for caching, not its callers.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler



  reply	other threads:[~2021-02-02 20:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 22:14 Get =#+RESULTS= without re-evaluating source code block? doltes
2021-01-27 22:38 ` tomas
2021-01-27 23:31   ` John Kitchin
2021-01-28  3:26     ` Greg Minshall
2021-02-02  2:10       ` John Kitchin
2021-02-02 20:02         ` Nick Dokos [this message]
2021-01-27 23:33   ` doltes

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=875z3az1a7.fsf@alphaville.usersys.redhat.com \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).