Fix package! mutating package state at expansion time

Fixes an issue where package! declarations were read unconditionally at
compile time, whether or not they were on a reachable code path. e.g.
evil is always disabled by:

  (when nil
    (package! evil :disable t))
This commit is contained in:
Henrik Lissner 2019-10-25 02:36:02 -04:00
parent 54559d567a
commit f516d4c342
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 39 additions and 42 deletions

View file

@ -81,7 +81,7 @@
Excludes packages that have a non-nil :built-in property."
(when-let (plist (doom-package-get package))
(not (eval (plist-get plist :ignore) t))))
(not (plist-get plist :ignore) t)))
;;;###autoload
(defun doom-package-private-p (package)
@ -176,7 +176,7 @@ ones."
;; We load the private packages file twice to ensure disabled packages
;; are seen ASAP, and a second time to ensure privately overridden
;; packages are properly overwritten.
(doom--read-module-packages-file private-packages t t))
(doom--read-module-packages-file private-packages nil t))
(if all-p
(mapc #'doom--read-module-packages-file
(doom-files-in doom-modules-dir