Fix #4010: respect custom org-export-async-init-file

This commit is contained in:
Henrik Lissner 2020-10-16 04:09:28 -04:00
parent 2e476de446
commit a835be1c40
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -483,13 +483,14 @@ the exported output (i.e. formatters)."
:around #'org-export-to-file :around #'org-export-to-file
(if (not org-export-in-background) (if (not org-export-in-background)
(apply orig-fn args) (apply orig-fn args)
(setq 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 ,debug-on-error (with-temp-file org-export-async-init-file
load-path ',load-path) (prin1 `(progn (setq org-export-async-debug ,debug-on-error
(load ,user-init-file nil t)) load-path ',load-path)
(current-buffer))) (load ,user-init-file nil t))
(apply orig-fn args)))) (current-buffer)))
(apply orig-fn args)))))
(defun +org-init-habit-h () (defun +org-init-habit-h ()