* 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
* Re: caching and code execution on export
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>
1 sibling, 0 replies; 3+ messages in thread
From: Eric Schulte @ 2011-07-01 19:57 UTC (permalink / raw
To: Ista Zahn; +Cc: emacs-orgmode Mailinglist
Ista Zahn <izahn@psych.rochester.edu> writes:
> 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.
Thanks for pointing this out. There were some export-specific header
arguments included in the cache calculation. I've just pushed up a fix
which fixes this issue. Please let me know if you notice any further
problems.
> Also, a quick question that I can't seem to find the answer to: what
> is the difference between "#+source <name>" and "#+srcname <name>"?
>
No difference, I believe that #+function <name> is another valid alias.
Thanks -- Eric
--
Eric Schulte
http://cs.unm.edu/~eschulte/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: caching and code execution on export
[not found] ` <18545_1309551236_4E0E2A84_18545_30539_1_87pqltlpxd.fsf@gmail.com>
@ 2011-07-02 13:40 ` Ista Zahn
0 siblings, 0 replies; 3+ messages in thread
From: Ista Zahn @ 2011-07-02 13:40 UTC (permalink / raw
To: Eric Schulte; +Cc: emacs-orgmode Mailinglist
Fantastic, the latest git version now works as expected. Thank you!
On Fri, Jul 1, 2011 at 3:57 PM, Eric Schulte <schulte.eric@gmail.com> wrote:
> Ista Zahn <izahn@psych.rochester.edu> writes:
>
>> 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.
>
> Thanks for pointing this out. There were some export-specific header
> arguments included in the cache calculation. I've just pushed up a fix
> which fixes this issue. Please let me know if you notice any further
> problems.
>
>> Also, a quick question that I can't seem to find the answer to: what
>> is the difference between "#+source <name>" and "#+srcname <name>"?
>>
>
> No difference, I believe that #+function <name> is another valid alias.
>
> Thanks -- Eric
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte/
>
--
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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.