[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: disable automatic source block evaluation but allow manual

From: Sébastien Vauban
Subject: [Orgmode] Re: disable automatic source block evaluation but allow manual
Date: Thu, 16 Dec 2010 10:48:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt)

Hi Andreas,

Andreas Leha wrote:
> is there an option (source block header argument) that allows to disable the
> evaluation of the block, but still allows C-c C-c to perform the evaluation?
> The header argument ':eval never' disables the evaluation completely. I'd
> like the C-c C-c to take precedence over this.
> So I guess I am looking for something like ':eval manual'

If I rewrite what I understood from your post, you want to make a clear
distinction between:

- allowing evaluation in the Org buffer (when *editing*)
- allowing evaluation when *exporting* it

In fact, I've been thinking at something that annoys me a bit, around this
similar subject: I find it weird to have a buffer that does not contain the
same up-to-date information as the exported (and updated) document.

Arbitrary example:

--8<---------------cut here---------------start------------->8---
* Sh code

#+begin_src sh :results output :exports both

: Thu, Dec 16, 2010 10:32:36 AM

#+begin_src sh :var thisfile=(buffer-file-name)
echo $(ls -lia "$thisfile" | cut -d " " -f 6) "Bytes in this buffer"

: 297 Bytes in this buffer
--8<---------------cut here---------------end--------------->8---

If I add words in that file, the number of characters will go up. That will be
correctly "visible" (shown) in the exported document.

But, *if I don't manually execute* all the code snippets above, they will have
a wrong output...[1]

... moreover, as said previously, it will always (in the above example) be
different from the HTML/PDF version of that buffer. It may lead to erroneous
appreciation of code results, and lead to different and unsynchronized
versions of documents (source Org file, exported documents).

I have a gut feeling that either:

- the export function should not evaluate any code block, or

- when evaluating them for the export, the Org buffer should be updated in the
  same way (results of evaluation copied back into the Org buffer).

I guess the first solution is not a good one. What about the second?

Best regards,

[1] Number of characters won't reflect the new values. And, even if I don't
touch it, the time information will be different between the Org and the
exported files.
Sébastien Vauban

reply via email to

[Prev in Thread] Current Thread [Next in Thread]