From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ista Zahn Subject: caching and code execution on export Date: Fri, 1 Jul 2011 12:08:01 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcgGX-0001iG-SD for emacs-orgmode@gnu.org; Fri, 01 Jul 2011 12:08:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcgGV-0000oH-6h for emacs-orgmode@gnu.org; Fri, 01 Jul 2011 12:08:25 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:62952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcgGU-0000o5-Mq for emacs-orgmode@gnu.org; Fri, 01 Jul 2011 12:08:23 -0400 Received: by wwf22 with SMTP id 22so2723619wwf.30 for ; Fri, 01 Jul 2011 09:08:21 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Mailinglist Hi all, I'm giving org-babel another go after a recent retreat back to Sweave. I'm having problems with code being executed on export, even when :cache yes is in force. Please see the following example. Also, a quick question that I can't seem to find the answer to: what is the difference between "#+source " and "#+srcname "? Thanks! Ista ============= 8< ============= example starts here <============= 8< ============= #+BABEL: :session *R* * Org-babel cache test ** Instructions 1. Start emacs in quiet mode (to rule out personal setting changing the results). 2. Evaluate the buffer and save it. 3. Evaluate it again. 4. Now export (e.g., to html) the buffer. ** Setup *** load ess #+source start-ess #+begin_src emacs-lisp :results silent :exports none (require 'ess-site) #+end_src *** Setup bable for R #+source setup-r-babel #+begin_src emacs-lisp :results silent :exports none (org-babel-do-load-languages 'org-babel-load-languages '((R . t))) #+end_src ** Test *** First R code block #+source: obtest #+begin_src R :cache yes x <- rnorm(10) Sys.sleep(5) #+end_src *** Second R code block #+source obtest2 #+begin_src R :cache yes y <- 10 Sys.sleep(5) #+end_src ** What happens Cached code blocks are not re-exectued in step 3, as intented. However, they are exectued in step 4. After much pain I found that setting org-export-babel-evaluate to nil fixed the problem. But a) I don't think this is the intended behavior, and b) if it is I think it should be changed. I've seen the discussion at http://comments.gmane.org/gmane.emacs.orgmode/40685 which seems to indicate that this should not be happening. ** Version Info GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2011-04-11 Org-mode version 7.4 (same thing on 7.5 from ELPA) ============= 8< ============= example ends here <============= 8< ============= -- Ista Zahn Graduate student University of Rochester Department of Clinical and Social Psychology http://yourpsyche.org