Fix package!'s :disable being read unconditionally

Because the package was added to doom-disabled-packages at macro
expansion time, rather than at run time. This meant that, even if you
did:

  (when nil
    (package! x :disable t))

x would still be disabled.

Reported by @ar1a
This commit is contained in:
Henrik Lissner 2018-06-24 12:08:55 +02:00
parent c69b4ab5ee
commit be44b1ae8a
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -207,8 +207,6 @@ elsewhere."
(and old-plist (plist-get old-plist :pin))))
(pkg-disable (or (plist-get plist :disable)
(and old-plist (plist-get old-plist :disable)))))
(when pkg-disable
(add-to-list 'doom-disabled-packages name nil #'eq))
(when pkg-recipe
(when (= 0 (% (length pkg-recipe) 2))
(setq plist (plist-put plist :recipe (cons name pkg-recipe))))
@ -222,6 +220,7 @@ elsewhere."
doom-private-dir)
(setq plist (plist-put plist :private t)))
`(progn
,(if pkg-disable `(add-to-list 'doom-disabled-packages ',name nil #'eq))
,(if pkg-pin `(setf (alist-get ',name package-pinned-packages) ,pkg-pin))
(setf (alist-get ',name doom-packages) ',plist)
(not (memq ',name doom-disabled-packages)))))