0

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?

2
  • 2
    From docstring of 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.
    – user12563
    Mar 28, 2018 at 11:59
  • Thanks, I should have looked at the docstring! Shouldn't you repost your comment as an answer? Mar 29, 2018 at 6:30

1 Answer 1

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.