From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: [babel] exports, caching, remote execution Date: Sat, 18 Sep 2010 20:11:49 -0600 Message-ID: <8739t5hcve.fsf@gmail.com> References: <87eig5en4p.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=57964 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OxNVu-0001jz-6J for emacs-orgmode@gnu.org; Sun, 19 Sep 2010 13:17:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OxNVs-0002TH-QF for emacs-orgmode@gnu.org; Sun, 19 Sep 2010 13:17:18 -0400 Received: from mail-pv0-f169.google.com ([74.125.83.169]:42682) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OxNVs-0002TB-Ls for emacs-orgmode@gnu.org; Sun, 19 Sep 2010 13:17:16 -0400 Received: by pvc30 with SMTP id 30so2613755pvc.0 for ; Sun, 19 Sep 2010 10:17:15 -0700 (PDT) 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: Tom Short Cc: emacs-orgmode@gnu.org Hi Tom, This turned out to be a fairly complicated issue. During export of a narrowed region the narrowed region will be coppied to a temporary buffer, when exporting from the buffer all buffer-wide, and headline-wide parameters which are not included in the region are ignored. This results in a different set of header arguments being used for interactive evaluation than were used for export evaluation. These differences in header arguments then invalidate the cache saved during the interactive evaluation. I've just put together and pushed a fix which involves jumping back to the original org file to collect header arguments in context during export. This appears to resolve the issue (at least for me). Please let me know if it works for you. Best -- Eric Tom Short writes: > Eric Schulte gmail.com> writes: > >> >> Hi Austin, >> >> Austin Frank gmail.com> writes: >> >> > Hey all-- >> > >> > Two (hopefully quick) questions: >> > >> > 1) Does the exporter respect the :cache argument? When I evaluate a >> > buffer, I can tell that cached blocks are not re-run, as expected. >> > When I export to \LaTeX or PDF, it seems that all blocks in the file >> > are re-run. Is there a way to force the exporter to respect caching? >> > >> >> I believe the exporter does respect caching, the following minimal >> example worked (i.e. was not re-run) for me on export to html. Could >> you provide an example that demonstrates the problem? > > Eric, here's an example where the exporter does not respect caching. - Tom > > #+BABEL: :session *R* :results output :exports both :cache yes > > * A test of caching > > #+begin_src R > cat("random result:", runif(1), "\n") > Sys.sleep(2) > alarm() > #+end_src > > #+results[b2549fac8a1ec2923ae289d47ce55fb2853dd1de]: > : random result: 0.2799064 > > #+begin_src R > cat("random result:", runif(1), "\n") > Sys.sleep(2) > alarm() > #+end_src > > #+results[b2549fac8a1ec2923ae289d47ce55fb2853dd1de]: > : random result: 0.1625634 > > ** cache on export > do we export cached blocks > > #+begin_src emacs-lisp :cache yes :exports results > (random) > #+end_src > > #+results[46632b4fe2e3a23e847953c95adcba58c270b381]: > : 490528137 > > > > > _______________________________________________ > 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