Eric S Fraga writes:
I tried but this doesn't seem to be propagated to the export as the export works on a copy of the buffer, not the buffer itself. That's what #+BIND is for, supposedly...
I think this buffer copy preserves local variables. I know I use a such a local variable and its value can be read during macro expansion.
It seems the org-export-before-parsing-hook functions are run before the #+BIND values are collected (see org-export-as in ox.el).
-- Sébastien Miquel