From c04bccc68b679ff523bc88a4e3925584cb7efbb1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 1 Jun 2018 17:03:01 +0200 Subject: [PATCH] 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. --- core/core-packages.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/core-packages.el b/core/core-packages.el index 0c3098d38..e0145f8ae 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -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)))