mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-08 15:23:35 -05:00
Move compile-time fix for disabled packages
This fix prevented the byte-compiler from trying to load packages that were disabled or failed their :when/:unless/:if predicates. This commit moves it into doom-byte-compile, so the :no-require predicate doesn't have to run on every package in an interactive session, eating MY PRECIOUS cpu cycles. I do love my cpu cycles, yessiree.
This commit is contained in:
@@ -733,8 +733,19 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
||||
(message "Couldn't find any valid targets")
|
||||
(message "No targets to %scompile" (if recompile-p "re" "")))
|
||||
(cl-return-from 'byte-compile))
|
||||
(condition-case ex
|
||||
(let ((use-package-expand-minimally t))
|
||||
(condition-case e
|
||||
(let ((use-package-defaults use-package-defaults)
|
||||
(use-package-expand-minimally t))
|
||||
;; Prevent packages from being loaded at compile time if they
|
||||
;; don't meet their own predicates.
|
||||
(push (list :no-require t
|
||||
(lambda (_name args)
|
||||
(or (when-let* ((pred (or (plist-get args :if)
|
||||
(plist-get args :when))))
|
||||
(not (eval pred t)))
|
||||
(when-let* ((pred (plist-get args :unless)))
|
||||
(eval pred t)))))
|
||||
use-package-defaults)
|
||||
;; Always compile private init file
|
||||
(push (expand-file-name "init.el" doom-private-dir) target-files)
|
||||
(push (expand-file-name "init.el" doom-emacs-dir) target-files)
|
||||
|
Reference in New Issue
Block a user