* Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)]
@ 2016-05-20 0:13 Ken Mankoff
2016-05-20 0:18 ` Ken Mankoff
2016-05-20 3:33 ` Charles C. Berry
0 siblings, 2 replies; 9+ messages in thread
From: Ken Mankoff @ 2016-05-20 0:13 UTC (permalink / raw)
To: emacs-org
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)
My full state is attached below, but I'm recreating the bug with a
simpler setup:
I'm running a clean Emacs with:
~/local/Applications/Emacs.app/Contents/MacOS/Emacs -Q ~/.emacs.d/simple.el
where the contents of "simple.el" are only:
;;------------------------------------------------
(add-to-list 'load-path "~/local/src/org-mode/lisp")
(add-to-list 'load-path "~/local/src/org-mode/contrib" t)
(require 'org)
(setq org-export-babel-evaluate nil)
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(octave . t)))
;;------------------------------------------------
If I evaluate the first 3 lines, I load the latest git head. If I do
not, I run Org 8.2.10. If I evaluate the 4th line, "(setq
org-export-babel-evaluate nil)", the bug does not appear in 8.2.10, but
does appear in git head.
I test it with the following file:
;;------------------------------------------------
#+BEGIN_SRC octave :exports results
"hello, world"
#+END_SRC
#+RESULTS:
: hello, world
;;------------------------------------------------
Which I then export to LaTeX. In Org 8.2.10 w/ or w/o
"org-export-babel-evaluate", I only see results. In git head, I see the
code and the results if it is set to 'nil'.
-k.
Emacs : GNU Emacs 24.5.1 (x86_64-apple-darwin14.5.0, Carbon Version 157 AppKit 1348.17)
of 2015-12-15 on bos-mp6ry
Package: Org-mode version 8.3.4 (release_8.3.4-824-ga02fe8 @ /Users/mankoff/local/src/org-mode/lisp/)
current state:
==============
(setq
org-export-babel-evaluate nil
org-tab-first-hook '(org-hide-block-toggle-maybe
org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
org-occur-hook '(org-first-headline-recenter)
org-metaup-hook '(org-babel-load-in-session-maybe)
org-html-format-drawer-function '(closure
(htmlize-buffer-places
org-html-format-table-no-css
htmlize-css-name-prefix
htmlize-output-type htmlize-output-type
htmlize-css-name-prefix t)
(_name contents) contents)
org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function
org-confirm-shell-link-function 'yes-or-no-p
org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
org-latex-format-headline-function 'org-latex-format-headline-default-function
org-after-todo-state-change-hook '(org-clock-out-if-current)
org-latex-format-drawer-function '(closure (t) (_ contents) contents)
org-odt-format-headline-function 'org-odt-format-headline-default-function
org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-babel-pre-tangle-hook '(save-buffer)
org-mode-hook '((closure
(org-inlinetask-min-level buffer-face-mode-face org-mode-map
org-tbl-menu org-org-menu org-struct-menu org-entities
org-last-state org-id-track-globally org-clock-start-time
texmathp-why remember-data-file
org-agenda-tags-todo-honor-ignore-options
iswitchb-temp-buflist calc-embedded-open-mode
calc-embedded-open-formula calc-embedded-close-formula
align-mode-rules-list zmacs-regions outline-mode-menu-hide
outline-mode-menu-show outline-mode-menu-heading
org-emphasis-alist org-emphasis-regexp-components
org-export-registered-backends org-modules
org-babel-load-languages t)
nil
(org-add-hook (quote change-major-mode-hook)
(quote org-show-block-all) (quote append) (quote local))
)
(lambda nil
(org-add-hook (quote change-major-mode-hook)
(quote org-babel-show-result-all) (quote append)
(quote local))
)
org-babel-result-hide-spec org-babel-hide-all-hashes)
org-archive-hook '(org-attach-archive-delete-maybe)
org-ascii-format-drawer-function '(closure (t) (_name contents _width)
contents)
org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
org-cycle-show-empty-lines
org-optimize-window-after-visibility-change)
org-confirm-elisp-link-function 'yes-or-no-p
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-odt-format-drawer-function '(closure
(hfy-user-sheet-assoc hfy-optimizations
hfy-html-quote-regex hfy-html-quote-map
hfy-face-to-css hfy-begin-span-handler
hfy-end-span-handler archive-zip-extract
nxml-auto-insert-xml-declaration-flag t)
(_name contents) contents)
org-html-format-headline-function 'org-html-format-headline-default-function
org-babel-load-languages '((emacs-lisp . t) (octave . t))
org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function
org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)]
2016-05-20 0:13 Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)] Ken Mankoff
@ 2016-05-20 0:18 ` Ken Mankoff
2016-05-20 3:33 ` Charles C. Berry
1 sibling, 0 replies; 9+ messages in thread
From: Ken Mankoff @ 2016-05-20 0:18 UTC (permalink / raw)
To: emacs-org
A bit of digging in git and I guess this commit may be related,
http://orgmode.org/w/?p=org-mode.git;a=commitdiff;h=ec615b192d703a0201ceefd46897e4636ff00a38
summarized as "Fix `org-export-babel-evaluate' handling"
-k.
On 2016-05-19 at 20:13, Ken Mankoff <mankoff@gmail.com> 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)
>
> My full state is attached below, but I'm recreating the bug with a
> simpler setup:
>
> I'm running a clean Emacs with:
>
> ~/local/Applications/Emacs.app/Contents/MacOS/Emacs -Q ~/.emacs.d/simple.el
>
> where the contents of "simple.el" are only:
>
> ;;------------------------------------------------
> (add-to-list 'load-path "~/local/src/org-mode/lisp")
> (add-to-list 'load-path "~/local/src/org-mode/contrib" t)
> (require 'org)
> (setq org-export-babel-evaluate nil)
> (org-babel-do-load-languages
> 'org-babel-load-languages
> '((emacs-lisp . t)
> (octave . t)))
> ;;------------------------------------------------
>
> If I evaluate the first 3 lines, I load the latest git head. If I do
> not, I run Org 8.2.10. If I evaluate the 4th line, "(setq
> org-export-babel-evaluate nil)", the bug does not appear in 8.2.10, but
> does appear in git head.
>
> I test it with the following file:
>
> ;;------------------------------------------------
> #+BEGIN_SRC octave :exports results
> "hello, world"
> #+END_SRC
> #+RESULTS:
> : hello, world
> ;;------------------------------------------------
>
>
> Which I then export to LaTeX. In Org 8.2.10 w/ or w/o
> "org-export-babel-evaluate", I only see results. In git head, I see the
> code and the results if it is set to 'nil'.
>
>
> -k.
>
>
>
> Emacs : GNU Emacs 24.5.1 (x86_64-apple-darwin14.5.0, Carbon Version 157 AppKit 1348.17)
> of 2015-12-15 on bos-mp6ry
> Package: Org-mode version 8.3.4 (release_8.3.4-824-ga02fe8 @ /Users/mankoff/local/src/org-mode/lisp/)
>
> current state:
> ==============
> (setq
> org-export-babel-evaluate nil
> org-tab-first-hook '(org-hide-block-toggle-maybe
> org-babel-hide-result-toggle-maybe
> org-babel-header-arg-expand)
> org-speed-command-hook '(org-speed-command-default-hook
> org-babel-speed-command-hook)
> org-occur-hook '(org-first-headline-recenter)
> org-metaup-hook '(org-babel-load-in-session-maybe)
> org-html-format-drawer-function '(closure
> (htmlize-buffer-places
> org-html-format-table-no-css
> htmlize-css-name-prefix
> htmlize-output-type htmlize-output-type
> htmlize-css-name-prefix t)
> (_name contents) contents)
> org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function
> org-confirm-shell-link-function 'yes-or-no-p
> org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
> org-latex-format-headline-function 'org-latex-format-headline-default-function
> org-after-todo-state-change-hook '(org-clock-out-if-current)
> org-latex-format-drawer-function '(closure (t) (_ contents) contents)
> org-odt-format-headline-function 'org-odt-format-headline-default-function
> org-src-mode-hook '(org-src-babel-configure-edit-buffer
> org-src-mode-configure-edit-buffer)
> org-agenda-before-write-hook '(org-agenda-add-entry-text)
> org-babel-pre-tangle-hook '(save-buffer)
> org-mode-hook '((closure
> (org-inlinetask-min-level buffer-face-mode-face org-mode-map
> org-tbl-menu org-org-menu org-struct-menu org-entities
> org-last-state org-id-track-globally org-clock-start-time
> texmathp-why remember-data-file
> org-agenda-tags-todo-honor-ignore-options
> iswitchb-temp-buflist calc-embedded-open-mode
> calc-embedded-open-formula calc-embedded-close-formula
> align-mode-rules-list zmacs-regions outline-mode-menu-hide
> outline-mode-menu-show outline-mode-menu-heading
> org-emphasis-alist org-emphasis-regexp-components
> org-export-registered-backends org-modules
> org-babel-load-languages t)
> nil
> (org-add-hook (quote change-major-mode-hook)
> (quote org-show-block-all) (quote append) (quote local))
> )
> (lambda nil
> (org-add-hook (quote change-major-mode-hook)
> (quote org-babel-show-result-all) (quote append)
> (quote local))
> )
> org-babel-result-hide-spec org-babel-hide-all-hashes)
> org-archive-hook '(org-attach-archive-delete-maybe)
> org-ascii-format-drawer-function '(closure (t) (_name contents _width)
> contents)
> org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
> org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
> org-babel-execute-safely-maybe)
> org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
> org-cycle-show-empty-lines
> org-optimize-window-after-visibility-change)
> org-confirm-elisp-link-function 'yes-or-no-p
> org-metadown-hook '(org-babel-pop-to-session-maybe)
> org-odt-format-drawer-function '(closure
> (hfy-user-sheet-assoc hfy-optimizations
> hfy-html-quote-regex hfy-html-quote-map
> hfy-face-to-css hfy-begin-span-handler
> hfy-end-span-handler archive-zip-extract
> nxml-auto-insert-xml-declaration-flag t)
> (_name contents) contents)
> org-html-format-headline-function 'org-html-format-headline-default-function
> org-babel-load-languages '((emacs-lisp . t) (octave . t))
> org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function
> org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
> )
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)]
2016-05-20 0:13 Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)] Ken Mankoff
2016-05-20 0:18 ` Ken Mankoff
@ 2016-05-20 3:33 ` Charles C. Berry
2016-05-20 11:12 ` Ken Mankoff
1 sibling, 1 reply; 9+ messages in thread
From: Charles C. Berry @ 2016-05-20 3:33 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)]
2016-05-20 3:33 ` Charles C. Berry
@ 2016-05-20 11:12 ` Ken Mankoff
2016-05-20 11:28 ` Ken Mankoff
0 siblings, 1 reply; 9+ messages in thread
From: Ken Mankoff @ 2016-05-20 11:12 UTC (permalink / raw)
To: Charles C. Berry; +Cc: emacs-org
On 2016-05-19 at 23:33, Charles C. Berry <ccberry@ucsd.edu> wrote:
> 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.
The documentation is: "Switch controlling code evaluation during export.
When set to nil no code will be evaluated as part of the export
process."
which is different than "all code and results will be exported". Evaluation and export are two different things.
> 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.
(setq org-export-babel-evaluate t)
#+BEGIN_SRC octave :exports results :cache nil
"hello, world"
#+END_SRC
#+RESULTS:
: hello, world
Yes, the above appears to work.
Thanks,
-k.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)]
2016-05-20 11:12 ` Ken Mankoff
@ 2016-05-20 11:28 ` Ken Mankoff
2016-05-20 17:29 ` Charles C. Berry
0 siblings, 1 reply; 9+ messages in thread
From: Ken Mankoff @ 2016-05-20 11:28 UTC (permalink / raw)
To: Charles C. Berry; +Cc: emacs-org
On 2016-05-20 at 07:12, Ken Mankoff <mankoff@gmail.com> wrote:
> On 2016-05-19 at 23:33, Charles C. Berry <ccberry@ucsd.edu> wrote:
>> On Thu, 19 May 2016, Ken Mankoff wrote:
>
> (setq org-export-babel-evaluate t)
>
> #+BEGIN_SRC octave :exports results :cache nil
> "hello, world"
> #+END_SRC
> #+RESULTS:
> : hello, world
>
> Yes, the above appears to work.
But it doesn't work with sessions. Can you advise what settings to have how I can have the following code in an Org document:
#+BEGIN_SRC python :results output :exports results :session foo :cache nil
print("hello, world")
#+END_SRC
#+RESULTS:
: hello, world
And easily export that document without evaluating the code?
Thanks,
-k.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)]
2016-05-20 11:28 ` Ken Mankoff
@ 2016-05-20 17:29 ` Charles C. Berry
2016-05-20 17:44 ` Ken Mankoff
0 siblings, 1 reply; 9+ messages in thread
From: Charles C. Berry @ 2016-05-20 17:29 UTC (permalink / raw)
To: Ken Mankoff; +Cc: emacs-org
On Fri, 20 May 2016, Ken Mankoff wrote:
>
> On 2016-05-20 at 07:12, Ken Mankoff <mankoff@gmail.com> wrote:
>> On 2016-05-19 at 23:33, Charles C. Berry <ccberry@ucsd.edu> wrote:
>>> On Thu, 19 May 2016, Ken Mankoff wrote:
>>
>> (setq org-export-babel-evaluate t)
>>
>> #+BEGIN_SRC octave :exports results :cache nil
>> "hello, world"
>> #+END_SRC
>> #+RESULTS:
>> : hello, world
>>
>> Yes, the above appears to work.
Really? I do not see the hash in your results block.
>
> But it doesn't work with sessions. Can you advise what settings to have how I can have the following code in an Org document:
>
> #+BEGIN_SRC python :results output :exports results :session foo :cache nil
> print("hello, world")
> #+END_SRC
> #+RESULTS:
> : hello, world
>
> And easily export that document without evaluating the code?
`:cache yes'
Of course, you must eval at least once with `:cache yes' to set the hash.
Chuck
p.s. I like to use stuff like
: import time
: print(time.strftime("%H:%M:%S"))
in src blocks to do :cache experiments
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)]
2016-05-20 17:29 ` Charles C. Berry
@ 2016-05-20 17:44 ` Ken Mankoff
2016-05-20 17:48 ` Charles C. Berry
0 siblings, 1 reply; 9+ messages in thread
From: Ken Mankoff @ 2016-05-20 17:44 UTC (permalink / raw)
To: Charles C. Berry; +Cc: emacs-org
On 2016-05-20 at 13:29, Charles C. Berry <ccberry@ucsd.edu> wrote:
> On Fri, 20 May 2016, Ken Mankoff wrote:
>>>
>>> #+BEGIN_SRC octave :exports results :cache nil
>>> "hello, world"
>>> #+END_SRC
>>> #+RESULTS:
>>> : hello, world
>>>
>>> Yes, the above appears to work.
>
> Really? I do not see the hash in your results block.
Correct. I've never used cache, and ":cache t" doesn't work, it has to be ":cache yes". I'll try to set this up and see if it works better w/ caching. That may be the trick as you suggested in the other thread, and perhaps most of the issues here are my improper use of cache (which wasn't required before).
-k.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)]
2016-05-20 17:44 ` Ken Mankoff
@ 2016-05-20 17:48 ` Charles C. Berry
2016-05-20 23:03 ` Ken Mankoff
0 siblings, 1 reply; 9+ messages in thread
From: Charles C. Berry @ 2016-05-20 17:48 UTC (permalink / raw)
To: Ken Mankoff; +Cc: emacs-org
On Fri, 20 May 2016, Ken Mankoff wrote:
>
> On 2016-05-20 at 13:29, Charles C. Berry <ccberry@ucsd.edu> wrote:
>> On Fri, 20 May 2016, Ken Mankoff wrote:
>>>>
>>>> #+BEGIN_SRC octave :exports results :cache nil
>>>> "hello, world"
>>>> #+END_SRC
>>>> #+RESULTS:
>>>> : hello, world
>>>>
>>>> Yes, the above appears to work.
>>
>> Really? I do not see the hash in your results block.
>
> Correct. I've never used cache, and ":cache t" doesn't work, it has to
> be ":cache yes". I'll try to set this up and see if it works better w/
> caching. That may be the trick as you suggested in the other thread, and
> perhaps most of the issues here are my improper use of cache (which
> wasn't required before).
>
But I see that you said:
>
> I'm still trying to find a way where:
> + code results do export
> + code does not export
> + code does not evaluate at export
> + code can still be evaluated by me
>
So, you want `:exports results :eval never-export' and forget about
`:cache yes'.
And leave `org-export-babel-evaluate' at `t'.
Also, see
(info "(org) eval")
Chuck
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)]
2016-05-20 17:48 ` Charles C. Berry
@ 2016-05-20 23:03 ` Ken Mankoff
0 siblings, 0 replies; 9+ messages in thread
From: Ken Mankoff @ 2016-05-20 23:03 UTC (permalink / raw)
To: Charles C. Berry; +Cc: emacs-org
Hi Chuck,
On 2016-05-20 at 13:48, Charles C. Berry <ccberry@ucsd.edu> wrote:
>> On Fri, 20 May 2016, Ken Mankoff wrote:
>>
>> I'm still trying to find a way where:
>> + code results do export
>> + code does not export
>> + code does not evaluate at export
>> + code can still be evaluated by me
>>
>
> So, you want `:exports results :eval never-export' and forget about
> `:cache yes'.
>
> And leave `org-export-babel-evaluate' at `t'.
>
> Also, see
> (info "(org) eval")
>
Yes, this setup now appears to work. Thank you! I can get back to work...
I think this option to :eval might also be useful for John Hendy who was manually toggling eval from no to yes.
-k.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-05-20 23:03 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-20 0:13 Bug: org-export-babel-evaluate causes everything to be exported [8.3.4 (release_8.3.4-824-ga02fe8)] Ken Mankoff
2016-05-20 0:18 ` Ken Mankoff
2016-05-20 3:33 ` Charles C. Berry
2016-05-20 11:12 ` Ken Mankoff
2016-05-20 11:28 ` Ken Mankoff
2016-05-20 17:29 ` Charles C. Berry
2016-05-20 17:44 ` Ken Mankoff
2016-05-20 17:48 ` Charles C. Berry
2016-05-20 23:03 ` Ken Mankoff
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).