emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [babel] By default, code blocks should not be evaluated during e


From: Eric Schulte
Subject: Re: [O] [babel] By default, code blocks should not be evaluated during export
Date: Fri, 08 Apr 2011 07:50:04 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi Paul,

Paul Sexton <address@hidden> writes:

> The default value of `org-export-babel-evaluate' is t. 
>

The `org-export-babel-evaluate' is more of an external safety measure
for people who don't want *any* code block evaluation ever and IMO could
probably be removed as there is already `org-confirm-babel-evaluate'
(which could be augmented to allow an option for silently disallowing
evaluation).

>
> Having just crashed my Emacs session 5 times in a row trying to get
> a file containing a BEGIN_SRC emacs-lisp ... END_SRC *code example*
> to export to HTML...
>
> I strongly feel it should default to nil.
>

I can understand your frustration, however while the above does not
default to nil, the default babel header argument do not evaluate code
on export.  See C-h v `org-babel-default-header-args'

,---- 
| org-babel-default-header-args is a variable defined in `ob.el'.
| Its value is ((:session . "none")
|  (:results . "replace")
|  (:exports . "code")
|  (:cache . "no")
|  (:noweb . "no")
|  (:hlines . "no")
|  (:tangle . "no")
|  (:padnewline . "yes"))
| 
| 
| Documentation:
| Default arguments to use when evaluating a source block.
| 
| [back]
`----

By default on export the code of code blocks will be exported, unless
you have changed the defaults in some way.  Also, unless you have
changed the value of `org-confirm-babel-evaluate' you should have been
prompted before any evaluation.  In fact after a quick local test with
'emacs -Q' emacs-lisp code blocks do not evaluate on export, so you have
something in your configuration explicitly causing this behavior.

>
> I also feel that "executable code block" and "quoted code example that I would
> like to display/export with pretty syntax highlighting" are two very different
> concepts, and should have different block names.
>
> eg #+BEGIN_EXEC for the executable blocks?
> or allow an argument to example blocks, eg "#+BEGIN_EXAMPLE python" ?
>

I very strongly disagree with this suggestion.  As I see it code blocks
hold code.  The use of the code is secondary to the content of the
block, and a header argument is an appropriate place to hold such usage
information.  Also, it is common to switch between exporting results and
exporting code, and it would be onerous to change the code-block name.
Finally, this would complicate all of the current code block handling
code, having two separate blocks for a single semantic entity.

Best Regards -- Eric

>
> Paul
>
>
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



reply via email to

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