From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] By default, code blocks should not be evaluated during export Date: Fri, 08 Apr 2011 07:50:04 -0600 Message-ID: <87k4f4ygl3.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=55354 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8CTU-0006hx-Ne for emacs-orgmode@gnu.org; Fri, 08 Apr 2011 10:15:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8CTS-0006Ol-Pa for emacs-orgmode@gnu.org; Fri, 08 Apr 2011 10:15:48 -0400 Received: from mail-gy0-f169.google.com ([209.85.160.169]:49202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8CTS-0006OM-Lu for emacs-orgmode@gnu.org; Fri, 08 Apr 2011 10:15:46 -0400 Received: by gyd8 with SMTP id 8so1760632gyd.0 for ; Fri, 08 Apr 2011 07:15:45 -0700 (PDT) In-Reply-To: (Paul Sexton's message of "Fri, 8 Apr 2011 04:23:26 +0000 (UTC)") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Paul Sexton Cc: emacs-orgmode@gnu.org Hi Paul, Paul Sexton 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/