fix(org): void-variable doom-user-dir on org-async export

This advice needed to be updated to reflect recent changes.

Fix: #6624
This commit is contained in:
Henrik Lissner 2022-09-16 03:16:31 +02:00
parent e499e05ff3
commit 511f0ca38f
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -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)
(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
(load ,(or old-async-init-file user-init-file)
nil t)
(delete-file load-file-name)))
(current-buffer)))
(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))))