Hello,

Bastien <b...@gnu.org> writes:

> Andreas Leha <andreas.l...@med.uni-goettingen.de> writes:
>
>> Hi Jambunathan and Nicolas,
>>
>>
>>>>> the new LaTeX exporter does not seem to "run" the
>>>>> org-export-latex-final-hook.  Is there an equivalent?
>>>>
>>>> You are looking for `:filter-final-output' within
>>>> `org-export-filters-alist'.
>
> Would that be useful to let the filters fall back on existing 
> value for ̀org-export-BACKEND-final-hook' and other hooks?

I'm not sure to understand. There is no such hook. Also, there are
differences between filters and current export hooks:

  - filters are applied on a string, current export hooks on a buffer;

  - filters provide the back-end called, current export hooks rely on
    a global variable that has been removed;

  - While run with arguments, filters are not equivalent to
    `run-hook-with-args' since they heavily rely on value returned;

  - filters from users and from developers are clearly separated, which
    allows the latter to always be executed before the former.

Now, as an exception, final output filters could be executed on a buffer
in a hook (by writing the string output to a temp buffer), but since
filters are so common in the new export engine, that extra step is
needed.

> Thus people won't have to change their configuration, plus hooks 
> are more familiar to Emacsers.

  (add-to-list 'org-export-filter-final-output-functions 'my-function)

vs

  (org-add-hook 'org-export-final-output-hook 'my-function)

I'm not sure the difference is worth the hassle.


Regards,

-- 
Nicolas Goaziou

Reply via email to