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)))
(defadvice! +org--fix-async-export-a (orig-fn &rest args)
:around #'org-export-to-file
(if (not org-export-in-background)
(apply orig-fn args)
(let ((user-init-file (or org-export-async-init-file user-init-file)))
(setq org-export-async-init-file (make-temp-file "doom-org-async-export"))
:around '(org-export-to-file org-export-as)
(let ((old-async-init-file org-export-async-init-file)
(org-export-async-init-file (make-temp-file "doom-org-async-export")))
(with-temp-file org-export-async-init-file
(prin1 `(progn (setq org-export-async-debug ,debug-on-error
(prin1 `(progn (setq org-export-async-debug
,(or org-export-async-debug
debug-on-error)
load-path ',load-path)
(load ,user-init-file nil t))
(load ,(or old-async-init-file user-init-file)
nil t)
(delete-file ,org-export-async-init-file))
(current-buffer)))
(apply orig-fn args)))))
(apply orig-fn args))))
(defun +org-init-habit-h ()