From f40a2e1ed7c4f89c9d4696b0d91aed4bdaeb0884 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 14 Nov 2020 13:52:11 -0500 Subject: [PATCH] lang/org: apply +org--fix-async-export-a to org-export-as --- modules/lang/org/config.el | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 9661b4561..d52892bc4 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -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")) - (with-temp-file org-export-async-init-file - (prin1 `(progn (setq org-export-async-debug ,debug-on-error - load-path ',load-path) - (load ,user-init-file nil t)) - (current-buffer))) - (apply orig-fn args))))) + :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 + ,(or org-export-async-debug + debug-on-error) + load-path ',load-path) + (load ,(or old-async-init-file user-init-file) + nil t) + (delete-file ,org-export-async-init-file)) + (current-buffer))) + (apply orig-fn args)))) (defun +org-init-habit-h ()