From ed25ab76f963d730eed1ea56cf5c47c540d7fa59 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 17 Aug 2020 21:46:54 -0400 Subject: [PATCH] Respect comp-eln-load-path in comp async process Thanks to @SwiftLawnGnome in hlissner/doom-emacs@295f806 --- core/core.el | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/core/core.el b/core/core.el index 7ac775a41..562bd53ec 100644 --- a/core/core.el +++ b/core/core.el @@ -269,15 +269,27 @@ config.el instead." (let ((user-init-file custom-file)) (apply orig-fn args))) -;; For gccemacs users: http://akrl.sdf.org/gccemacs.html + +;; +;;; Native Compilation support (http://akrl.sdf.org/gccemacs.html) + +;; Don't store eln files in ~/.emacs.d/eln-cache (they are likely to be purged +;; when upgrading Doom). +(when (boundp 'comp-eln-load-path) + (add-to-list 'comp-eln-load-path (concat doom-cache-dir "eln/"))) + (after! comp ;; Prevent unwanted runtime builds; packages are compiled ahead-of-time when ;; they are installed and site files are compiled when gccemacs is installed. (setq comp-deferred-compilation nil) - ;; Don't store eln files in ~/.emacs.d; it's likely to be purged when - ;; upgrading Doom. - (when (boundp 'comp-eln-load-path) - (add-to-list 'comp-eln-load-path (concat doom-cache-dir "eln/"))) + ;; HACK `comp-eln-load-path' isn't fully respected yet, because native + ;; compilation occurs in another emacs process that isn't seeded with our + ;; value for `comp-eln-load-path', so we inject it ourselves: + (unless doom-reloading-p ; only apply this once! + (setq comp-async-env-modifier-form + `(progn + ,comp-async-env-modifier-form + (setq comp-eln-load-path ',comp-eln-load-path)))) ;; HACK Disable native-compilation for some troublesome packages (add-to-list 'comp-deferred-compilation-black-list "/evil-collection-vterm\\.el\\'"))