fix(literate): load doom core when tangling

This exposes Doom's stdlib to the sub-process that tangles your literate
config, so that src blocks therein (or their header arguments) can call
upon them or reference its variables (like IS-LINUX et co).

Fix: #6588
This commit is contained in:
Henrik Lissner 2022-07-23 16:03:55 +02:00
parent e7d56f2ce7
commit 043d32fefd
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -66,16 +66,14 @@
(start-process "tangle-config"
(get-buffer-create " *tangle config*")
"emacs" "--batch"
"--load" (doom-path doom-core-dir "core")
"--load" (doom-path doom-core-dir "autoload/print")
"--eval"
(prin1-to-string
`(progn
(require 'cl-lib)
(require 'subr-x)
(load ,(doom-path doom-core-dir "autoload/print"))
(funcall #',(symbol-function #'+literate-tangle)
`(funcall #',(symbol-function #'+literate-tangle)
,+literate-config-file
,(concat doom-module-config-file ".el")
,doom-private-dir)))))
,doom-private-dir))))
(add-hook 'kill-emacs-hook #'+literate-tangle-check-finished-h)
(set-process-sentinel +literate-tangle--async-proc #'+literate-tangle--async-sentinel)
(run-at-time nil nil (lambda () (message "Tangling config.org"))) ; ensure shown after a save message