[Top][All Lists]

[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: Nick Dokos
Subject: Re: [O] [babel] By default, code blocks should not be evaluated during export
Date: Fri, 08 Apr 2011 11:28:58 -0400

Eric Schulte <address@hidden> wrote:

> Paul Sexton <address@hidden> writes:
> >
> > 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'
> >
> > 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.

FWIW, I agree with Eric (modulo any bugs that might exist of course) -
otherwise babel loses much of its appeal for literate programming.

There are a couple of questions that need to be answered however:

o why is the code block evaluated during export in Paul's case? That may
be a result of Paul's config or a bug in babel - in either case, that
should be easy to fix and Eric addressed that.

o why did Paul's emacs session crash? That might be an emacs bug that
will need to be addressed. Even if Paul's elisp code is completely
broken, *it should not crash emacs*. Paul, can you post the code?
Actually, the whole org file if that's possible, as well as emacs and
org version?


reply via email to

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