emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ista Zahn <izahn@psych.rochester.edu>
To: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: caching and code execution on export
Date: Fri, 1 Jul 2011 12:08:01 -0400	[thread overview]
Message-ID: <BANLkTimJGuM3Ag0COBCre-y3=L5MAJhNNw@mail.gmail.com> (raw)

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

             reply	other threads:[~2011-07-01 16:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01 16:08 Ista Zahn [this message]
2011-07-01 19:57 ` caching and code execution on export Eric Schulte
     [not found] ` <18545_1309551236_4E0E2A84_18545_30539_1_87pqltlpxd.fsf@gmail.com>
2011-07-02 13:40   ` Ista Zahn

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='BANLkTimJGuM3Ag0COBCre-y3=L5MAJhNNw@mail.gmail.com' \
    --to=izahn@psych.rochester.edu \
    --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).