Ignore package! if package is disabled

This allows you to disable packages with (def-package-hook! X :disable)
without an accompanying (package! X :ignore t). This reduces redundancy.
This commit is contained in:
Henrik Lissner 2018-03-12 13:12:40 -04:00
parent a8906cc077
commit 5c36519dab
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -527,22 +527,23 @@ Accepts the following properties:
:ignore FORM Do not install this package if FORM is non-nil. :ignore FORM Do not install this package if FORM is non-nil.
:freeze FORM Do not update this package if FORM is non-nil." :freeze FORM Do not update this package if FORM is non-nil."
(declare (indent defun)) (declare (indent defun))
(let* ((old-plist (assq name doom-packages)) (unless (memq name doom-disabled-packages)
(pkg-recipe (or (plist-get plist :recipe) (let* ((old-plist (assq name doom-packages))
(and old-plist (plist-get old-plist :recipe)))) (pkg-recipe (or (plist-get plist :recipe)
(pkg-pin (or (plist-get plist :pin) (and old-plist (plist-get old-plist :recipe))))
(and old-plist (plist-get old-plist :pin))))) (pkg-pin (or (plist-get plist :pin)
(when pkg-recipe (and old-plist (plist-get old-plist :pin)))))
(when (= 0 (% (length pkg-recipe) 2)) (when pkg-recipe
(plist-put plist :recipe (cons name pkg-recipe))) (when (= 0 (% (length pkg-recipe) 2))
(when pkg-pin (plist-put plist :recipe (cons name pkg-recipe)))
(plist-put plist :pin nil))) (when pkg-pin
(dolist (prop '(:ignore :freeze)) (plist-put plist :pin nil)))
(when-let* ((val (plist-get plist prop))) (dolist (prop '(:ignore :freeze))
(plist-put plist prop (eval val)))) (when-let* ((val (plist-get plist prop)))
`(progn (plist-put plist prop (eval val))))
,(if (and pkg-pin t) `(map-put package-pinned-packages ',name ,pkg-pin)) `(progn
(map-put doom-packages ',name ',plist)))) ,(if (and pkg-pin t) `(map-put package-pinned-packages ',name ,pkg-pin))
(map-put doom-packages ',name ',plist)))))
(defmacro depends-on! (module submodule &optional flags) (defmacro depends-on! (module submodule &optional flags)
"Declares that this module depends on another. "Declares that this module depends on another.