From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)] Date: Thu, 19 May 2016 20:33:23 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3bBs-0004BM-Dh for emacs-orgmode@gnu.org; Thu, 19 May 2016 23:33:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3bBn-0007vo-DO for emacs-orgmode@gnu.org; Thu, 19 May 2016 23:33:31 -0400 Received: from iport-acv1-out.ucsd.edu ([132.239.0.176]:41184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3bBn-0007vZ-4M for emacs-orgmode@gnu.org; Thu, 19 May 2016 23:33:27 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Ken Mankoff Cc: emacs-org On Thu, 19 May 2016, Ken Mankoff wrote: > > I've noticed that code and results are all getting exported in the > latest Org mode git head. This is new behavior. I haven't traced > it to what commit caused this change, but the stock 8.2.10 install does > not have this bug. > > The offending setting is: > > (setq org-export-babel-evaluate nil) I think this is a *feature* not a bug. It turns off all of babel on export. So the code will still be there and any results that were already in the buffer will also be there. You can use `org-babel-remove-result-one-or-many' with a prefix if you want results to be stripped (prior to export, say). You can use :cache to prevent re-evaluation of code blocks and set org-export-babel-evaluate to t. Then the `:exports results' blocks will not have their code run nor exported. If you want to avoid babel, but still have header-args govern the appearance of the export, you have a lot of work to do. The exporter does not get automatic access to the header-args, so stuff like `#+PROPERTY: header-args :exports results' would be hard for the src-block transcoder to find. A workaround that might suffice is to defun `org-export-my-src-block' to return nothing, then use it as the src-block transcoder in a derived export backend. Then all the code disappears on export. There are some other possibilities like hacks involving babel. Probably better to stay away from those. HTH, Chuck