Fix #4651: don't trigger formatters on org tangle

This commit is contained in:
Henrik Lissner 2021-03-10 12:58:04 -05:00
parent 7c38eee96c
commit 377608c54b

View file

@ -523,10 +523,10 @@ relative to `org-directory', unless it is an absolute path."
(mathjax . t)
(variable . "revealjs-url=https://revealjs.com"))))
(defadvice! +org--dont-trigger-save-hooks-on-export-a (orig-fn &rest args)
"`org-export-to-file' triggers save hooks, which may inadvertantly change
the exported output (i.e. formatters)."
:around #'org-export-to-file
(defadvice! +org--dont-trigger-save-hooks-a (orig-fn &rest args)
"Exporting and tangling trigger save hooks; inadvertantly triggering
mutating hooks on exported output, like formatters."
:around '(org-export-to-file org-babel-tangle)
(let (before-save-hook after-save-hook)
(apply orig-fn args)))