I am using org-reveal for presentation
It has a #+BEGIN_NOTES
for creating speaker notes
Tried to shorten with this macro n
following this suggestion
#+MACRO: n (eval "\n#+BEGIN_NOTES\n$1\n#+END_NOTES\n")
It works if I use {{{n(some notes)}}}
in a single file
But if the file #+Include:
some other file I get strange errors on export:
eval: Wrong number of arguments: eval, 5
This is org mode version 8.3beta
When I switched to 9.3.8 I got an eval error in the outside file itself
And org 9.4 doesnt load at all so I assumed its too bleeding edge and hurriedly went back
Yeah my emacs is a bit old: 24.5.1; can't afford an upgrade at this point
Added later in response to @NickD
I tried digging... And found that
org-export-expand-as
doesn't seem to be used in org-reveal.
So I did the following
- Moved the macro out from the org into lisp and removed the
eval
(setq org-export-global-macros '(("n" . "\n#+BEGIN_NOTES\n$1\n#+END_NOTES\n")))
- Ran
M-: (org-export-expand-include-keyword)
M-: (org-macro-replace-all org-export-global-macros)
After this reveal exporter works
Unfortunately my simplistic try at automating the above doesnt work
(defun mymacro-expand ()
(widen)
(let ((c (buffer-substring-no-properties (point-min) (point-max))))
(with-temp-file "ttt.org"
(insert c)
(org-export-expand-include-keyword)
(org-macro-replace-all org-export-global-macros))
))
- I guess I should file a org-reveal bug report
But if you can suggest an alternative to above using org-expand-as that'd be great!
Addition 2
Downloaded and compiled emacs
Now its at version 28.0.50
Org version 9.4
It now seems that the $1
inside the string breaks whereas the format
version doesn't.
Error message is eval: Wrong number of arguments: eval, 4
Can you try with these two files?
$ cat foo.org
#+TITLE: Some title
#+MACRO: n (eval "\n#+BEGIN_NOTES\n$1\n#+END_NOTES\n")
* Outside heading
#+Include: bar.org
$ cat bar.org
* Inside heading
Some text
{{{n(internal note)}}}
Some more text
org-export-as
. But is this still 8.3? That's too old to have it. Moveing to the latest version of org that works with your emacs is recommended, I think.org-export-as
is the Org mode function that gets called at the top level to export a file: it orchestrates the export by calling functions defined in each exporter (in a table-driven fashon) so you will find it as I pointed out indirectly in my comment (after my answer) inox.el
, not in any particular exporter."\n#+BEGIN_NOTES\n$1\n#+END_NOTES\n"
becomes"\n#+BEGIN_NOTES\n"internal note"\n#+END_NOTES\n"
. That is why only the format version works.