I would like to execute emacs-lisp code at export time and that this code to be defined in another file (using SETUPFILE
).
Let's consider this two simple files :
main.org
#+setupfile: setup.org
Something
setup.org
#+name: mycode
#+begin_src emacs-lisp :export results :eval yes :results silent
(message "DEBUG")
#+end_src
When I try to export main.org
I thought that the DEBUG
message should be printed in Emacs Messages which is not the case.
I thought that live code block were evaluated at export which, here, is not the case.
Am I doing something wrongly or did I miss something in the doc?
I am using Emacs 27.1 (from Debian bullseye) and org-mode 9.4 (from elpa).
Update: as stated by @NickD in his comment the word :results
was misspelled in my example. Once corrected everything seems to work correctly when using #+INCLUDE:
but still not working with #+SETUPFILE:
.
#+INCLUDE:
rather than#+SETUPFILE:
in this case.:exports
with ans
, but:exports results
and:results silent
will cancel each other out and produce nothing (maybe last option wins but I have not tested). Try:exports code
or:exports both
and lose the:results silent
if you want the results to be part of the exported output.:exports
. In my example:exports results
and:result silent
do not cancel each other since the code has the side effect of writing to the Messages buffer.