From ce3e6555d3e24a6bf75d34fdf8a2bb67bfee3e4e Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 1 Mar 2013 08:30:44 +0100 Subject: [PATCH] ox: Ignore `org-mode-hook' and `kill-emacs-hook' in asynchronous export * lisp/ox.el (org-export-async-start): Ignore `org-mode-hook' and `kill-emacs-hook'. The first one has been run in the original buffer. The second is not necessary and can pollute output to a temporary buffer (e.g. with `org-clock-persistence-insinuate'). --- lisp/ox.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/ox.el b/lisp/ox.el index 3ea34de1e..dce804631 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -5091,6 +5091,10 @@ and "%S" `(with-temp-buffer ,(when org-export-async-debug '(setq debug-on-error t)) + ;; Ignore `org-mode-hook' as it has been run already + ;; in the original buffer. Ignore `kill-emacs-hook' + ;; as we need a truly non-interactive process. + (setq org-mode-hook nil kill-emacs-hook nil) ;; Initialize `org-mode' and export framework in the ;; external process. (org-mode) -- 2.11.4.GIT