From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: Suppressing src block evaluationon publish? Date: Thu, 03 Feb 2011 10:38:08 +0000 Message-ID: References: <87hbcn3fzr.fsf@slate.zedat.fu-berlin.de> <4D482F7F.2060004@ccbr.umn.edu> <87bp2t34z3.fsf@slate.zedat.fu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=38362 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkwaG-00056y-Vk for emacs-orgmode@gnu.org; Thu, 03 Feb 2011 05:38:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkwZr-0006X5-Vc for emacs-orgmode@gnu.org; Thu, 03 Feb 2011 05:38:17 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:35854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkwZr-0006X0-QZ for emacs-orgmode@gnu.org; Thu, 03 Feb 2011 05:38:15 -0500 Received: by wyj26 with SMTP id 26so987028wyj.0 for ; Thu, 03 Feb 2011 02:38:14 -0800 (PST) In-Reply-To: <87bp2t34z3.fsf@slate.zedat.fu-berlin.de> (Loris Bennett's message of "Thu, 03 Feb 2011 09:19:28 +0100") 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: Loris Bennett Cc: emacs-orgmode@gnu.org Loris Bennett writes: > Erik Iverson writes: > >> Loris Bennett wrote: >>> Hi, >>> >>> I have an org file containing several src blocks which generate images >>> using ditaa. When I publish to PDF via LaTeX, the images are all >>> generated every time, which makes publishing rather slow. >>> >>> Is there some way to toggle the evaluation of the src blocks on and off >>> when the file is published? >>> >> >> You could try the :cache header argument, http://orgmode.org/org.html#cache >> > > Ah, thanks. There is a slight gotcha here, though. > > I added :cache yes to the source headers and exported again, but nothing > changed; all the images were generated again. Also, no SHA1 hash was > added to the +results header. > > After some fruitless fiddling I was about to write to the list again and > moan, when I did a slightly random C-c C-c in the begin_src line and, > hey presto, the hash was added to the results header. I then did this > for all the images and found that the image were no longer regenerated > on export, as advertised. Hi Loris, Yes. It does seem that it would be nice if in this situation, the first export added the SHA1s, and subsequent exports recognized that evaluation wasn't required. I think the reason this does not happen is that behind-the-scenes Org makes a copy of the buffer for export preprocessing (including src block evaluation). But Eric S is the expert -- he may have more to say here. A couple of things that might be relevant here: the variable `org-export-babel-evaluate' can also be used to prevent evaluation on export (but the :cache approach has advantages). And C-c C-v C-b / C-c C-v C-s (`org-babel-evaluate-buffer' / `org-babel-execute-subtree') could be used to update the SHA1s. > Perhaps the documentation of :cache could be extended to mention the > necessity of evaluating the source block before exporting. I've added that to the TODO list. Dan > > > Loris >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >>