When I eval (add-hook 'org-export-before-processing-hook #'org-update-all-dblocks)
in an emacs session, function org-update-all-dblocks
seems to be called at the preprocessing stage of export, as expected. However, if i add the hook using the above line in .emacs and -- after restarting my GNU Emacs instance -- I call the LaTeX export function with C-c C-e l o
from an org document, I get the error message "Wrong number of arguments: (0 . 0), 1" reported from the run-hook-with-args
function. It is as if the org-export-before-processing-hook runs the hooked functions with an argument. Am I even supposed to adapt that variable? Also, how to achieve executing dynamic blocks on export, if what I attempted here is not the way?
1 Answer
Here's the relevant part of docstring for org-export-before-processing-hook
:
Every function in this hook will be called with one argument: the back-end currently used, as a symbol.
You can just wrap the function you want to use in a lambda that takes the right amount of arguments if you don't need a check whether you're using the right back-end.
org-export-before-processing-hook
:Every function in this hook will be called with one argument: the back-end currently used, as a symbol.
. You can either check the right backend is used or just wrap this function in a lambda that takes a single argument and doesn't use it.