From 511f0ca38fbdda782813e9f311ad027103ecdb22 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 16 Sep 2022 03:16:31 +0200 Subject: [PATCH] fix(org): void-variable doom-user-dir on org-async export This advice needed to be updated to reflect recent changes. Fix: #6624 --- modules/lang/org/config.el | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 965c71800..f66125230 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -629,16 +629,17 @@ mutating hooks on exported output, like formatters." :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) - (unwind-protect - (load ,(or old-async-init-file user-init-file) - nil t) - (delete-file load-file-name))) - (current-buffer))) + (doom-file-write + org-export-async-init-file + `((setq org-export-async-debug ,(or org-export-async-debug debug-on-error) + load-path ',load-path) + (unwind-protect + (let ((init-file ,old-async-init-file)) + (if init-file + (load init-file nil t) + (load ,early-init-file nil t) + (require 'doom-start))) + (delete-file load-file-name)))) (apply fn args))))