From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: exporting documents w/ babel results w/o evaluating babel blocks Date: Sun, 22 May 2016 14:58:43 -0500 Message-ID: References: <878addc2b6b14ce99e907921f0985d24@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <87a8jkoec6.fsf@ucl.ac.uk> <87wpmomz6x.fsf@ucl.ac.uk> <871t4wd0to.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4ZWQ-0000rI-TF for emacs-orgmode@gnu.org; Sun, 22 May 2016 15:58:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4ZWO-0000KQ-Fl for emacs-orgmode@gnu.org; Sun, 22 May 2016 15:58:45 -0400 Received: from mail-vk0-x22e.google.com ([2607:f8b0:400c:c05::22e]:34298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4ZWO-0000KM-95 for emacs-orgmode@gnu.org; Sun, 22 May 2016 15:58:44 -0400 Received: by mail-vk0-x22e.google.com with SMTP id c189so200398241vkb.1 for ; Sun, 22 May 2016 12:58:43 -0700 (PDT) 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: "Charles C. Berry" Cc: Nick Dokos , emacs-orgmode On Fri, May 20, 2016 at 4:20 PM, Charles C. Berry wrote: > On Fri, 20 May 2016, Nick Dokos wrote: > >> Ken Mankoff writes: >> > [deleted discussion of `org-export-babel-evaluate' settings] > >> >> With ":exports results" and o-e-b-e set to nil, I get no evaluation on >> export, but I get both code and results in the output. >> >>> There may have been a misunderstanding, but when I mentioned this in >>> the bug report, I was told this is a "feature". >>> >>> http://thread.gmane.org/gmane.emacs.orgmode/107230/focus=107231 >>> >> >> Not sure what exactly Chuck meant is a feature, but IIUC, the fact >> that I get both code and results even if I specify ":exports results" >> looks like a bug to me. >> > > I meant this, as of commit ec615b1..., `org-export-babel-evaluate' set to > `nil' keeps the exporter from running this line > > (org-export-execute-babel-code) > > during exports. So, 'no Babel code is run' in the sense that the above > line does not execute. > > src-blocks and inline-src-blocks are neither run nor removed, and no > #+results: or {{{results()}}} are added, removed, or > modified. Babel handles all that. The exporter merely formats those > things once Babel is done. > > So the bug, if any, is in the docstring in failing to mention that > everything that babel does is switched off. I don't entirely follow. Is there an intermediate step between a .org src block, babel, and the exporter? If so, the behavior I see could make sense. If not, then it doesn't. As in, why is babel "execution" (as in o-e-b-e to non-nil) required to *not* export this code into the resultant pdf? #+begin_src R :exports results :results output dat <- 1:10 print(dat) #+end_src With o-e-b-e set to nil, I get the code in the exported document, hence my asking. If I turn o-e-b-e on, I don't (but get the results). So perhaps the real missing bit from the documentation is something like "all babel functionality is turned off, and babel is responsible for executing code and generating/updating any results, as well as controlling src block export controls (results vs. code vs. both). In other words, without babel, src blocks in .org files are treated like example blocks during export." Is that accurate? I think one of the main points of confusion in this thread still has to do with why o-e-b-e switches what gets exported. If no code/results are run/added/removed/modified as you mention, it doesn't speak to why code export is always done for o-e-b-e = nil, but not otherwise. This suggests babel is doing more than "executing code;" it's somehow influencing what makes it into the export document. At least for me, that was an unexpected interpretation of "everything babel does is switched off." In fact, I just had an idea... I have o-e-b-e set to always, but just turned org-confirm-babel-evaluate to on (I typically have it off). If export the above and type "no" to make sure the code block is not executed I do *not* get the code in the document. I think this confirms that babel's responsibilities include *what* plain text in .org the exporter formats into the output format. My suggestion would be to create a different variable to handle formatting vs. execution unless things were designed this way? It seems from all the comments that the majority of users expect the time-heavy *code* not to be run at each export but still prefer the blocks to behave as they intended. Theoretically, with all of my results generated (e.g. into .pdf, .png, etc. plots; ascii tables, whatever) shouldn't I be able to have o-e-b-e set to whatever and get the same document? My document no longer depends on any of the code... so I don't need it run, but the exported document will behave like :exports both instead of :exports results just from turning babel off. John > > Since the behavior that the OP wanted can be had by setting babel > header args, I don't see this as a bug even though the behavior > changed in a way that surprised him. > > Chuck >