emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* caching and code execution on export
@ 2011-07-01 16:08 Ista Zahn
  2011-07-01 19:57 ` Eric Schulte
       [not found] ` <18545_1309551236_4E0E2A84_18545_30539_1_87pqltlpxd.fsf@gmail.com>
  0 siblings, 2 replies; 3+ messages in thread
From: Ista Zahn @ 2011-07-01 16:08 UTC (permalink / raw)
  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 <name>" and  "#+srcname <name>"?

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-02 13:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-01 16:08 caching and code execution on export Ista Zahn
2011-07-01 19:57 ` Eric Schulte
     [not found] ` <18545_1309551236_4E0E2A84_18545_30539_1_87pqltlpxd.fsf@gmail.com>
2011-07-02 13:40   ` Ista Zahn

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).