I need to have automatic evaluation turned on for elisp (or emacs-lisp) because I have huge documents that I export to PDF with batch scripts, and it's intolerable to have to go in and manually evaluate elisp blocks. Here is an MVE:
Consider the following org-babel file
#+BEGIN_SRC elisp :exports both
(+ 1 41)
#+END_SRC
#+BEGIN_SRC python :exports both :results output
print 'only python, no lisp for y00'
#+END_SRC
I can evaluate either code block by placing point in them and typing C-c C-c
. In each block, I get an interactive security question Evaluate this (elisp / python) code block on your system?
Great, no problem. Doing that for both, I get
#+BEGIN_SRC elisp :exports both
(+ 1 41)
#+END_SRC
#+RESULTS:
: 42
#+BEGIN_SRC python :exports both :results output
print 'only python, no lisp for y00'
#+END_SRC
#+RESULTS:
: only python, no lisp for y00
Ok, I now remove the #+RESULTS
blocks and type M-x org-babel-export-to-pdf
. I only get the security question for the python block, and not for the elisp block. The PDF output only has the results for the python block and not for the elisp block.
Looks like some setting has auto-evaluation-on-export or some such turned off for elisp. Changing the code type to emacs-lisp for the elisp block does not fix it.
elisp
toemacs-lisp
. Also I haveorg-confirm-babel-evaluate
set tonil
andemacs-lisp
mentioned inorg-babel-do-load-languages
.emacs-lisp
andemacs-lisp
mentioned inorg-babel-do-load-languages
). The setting oforg-confirm-babel-evaluate
does not seem to matter. I had to do a restart of emacs to see it operate correctly. If you promote your comment to an answer, I will mark it so.