lang/org: apply +org--fix-async-export-a to org-export-as

This commit is contained in:
Henrik Lissner 2020-11-14 13:52:11 -05:00
parent ecca37b07b
commit f40a2e1ed7
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -491,17 +491,19 @@ the exported output (i.e. formatters)."
(apply orig-fn args))) (apply orig-fn args)))
(defadvice! +org--fix-async-export-a (orig-fn &rest args) (defadvice! +org--fix-async-export-a (orig-fn &rest args)
:around #'org-export-to-file :around '(org-export-to-file org-export-as)
(if (not org-export-in-background) (let ((old-async-init-file org-export-async-init-file)
(apply orig-fn args) (org-export-async-init-file (make-temp-file "doom-org-async-export")))
(let ((user-init-file (or org-export-async-init-file user-init-file))) (with-temp-file org-export-async-init-file
(setq org-export-async-init-file (make-temp-file "doom-org-async-export")) (prin1 `(progn (setq org-export-async-debug
(with-temp-file org-export-async-init-file ,(or org-export-async-debug
(prin1 `(progn (setq org-export-async-debug ,debug-on-error debug-on-error)
load-path ',load-path) load-path ',load-path)
(load ,user-init-file nil t)) (load ,(or old-async-init-file user-init-file)
(current-buffer))) nil t)
(apply orig-fn args))))) (delete-file ,org-export-async-init-file))
(current-buffer)))
(apply orig-fn args))))
(defun +org-init-habit-h () (defun +org-init-habit-h ()