Fix disabled packages not being disabled

By loading the private packages.el in two passes. The first time ensures
later modules will know about disabled packages and the second time
ensures overwritten packages are properly overwritten.

Not the most efficient, but efficiency is low priority in noninteractive
sessions (i.e. during package management), the performance loss is
negligible, and packages.el files (should) have no other side effects
anyway.
This commit is contained in:
Henrik Lissner 2018-06-01 17:03:01 +02:00
parent 6bad6d12f3
commit c04bccc68b
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -338,6 +338,10 @@ them."
(error-message-string ex))))))
(let ((doom--stage 'packages))
(_load (expand-file-name "packages.el" doom-core-dir))
;; 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.
(_load (expand-file-name "packages.el" doom-private-dir))
(cl-loop for key being the hash-keys of doom-modules
for path = (doom-module-path (car key) (cdr key) "packages.el")
do (let ((doom--current-module key)) (_load path t)))