Change how private & disabled packages are marked
They are now included in doom-packages, but with :private t or :disabled t properties. This allows us to search for them if we wish (e.g. for doom info).
This commit is contained in:
parent
88f1ae3797
commit
edb6fd1964
1 changed files with 26 additions and 25 deletions
|
@ -753,31 +753,32 @@ Returns t if package is successfully registered, and nil if it was disabled
|
||||||
elsewhere."
|
elsewhere."
|
||||||
(declare (indent defun))
|
(declare (indent defun))
|
||||||
(doom--assert-stage-p 'packages #'package!)
|
(doom--assert-stage-p 'packages #'package!)
|
||||||
(cond ((memq name doom-disabled-packages) nil)
|
(let* ((old-plist (cdr (assq name doom-packages)))
|
||||||
((let ((disable (plist-get plist :disable)))
|
(pkg-recipe (or (plist-get plist :recipe)
|
||||||
(and disable (eval disable)))
|
(and old-plist (plist-get old-plist :recipe))))
|
||||||
(push name doom-disabled-packages)
|
(pkg-pin (or (plist-get plist :pin)
|
||||||
(setq doom-packages (map-delete doom-packages name))
|
(and old-plist (plist-get old-plist :pin))))
|
||||||
nil)
|
(pkg-disable (or (plist-get plist :disable)
|
||||||
((let* ((old-plist (assq name doom-packages))
|
(and old-plist (plist-get old-plist :disable)))))
|
||||||
(pkg-recipe (or (plist-get plist :recipe)
|
(when pkg-disable
|
||||||
(and old-plist (plist-get old-plist :recipe))))
|
(add-to-list 'doom-disabled-packages name nil #'eq))
|
||||||
(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
|
(setq plist (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)))
|
(setq plist (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))
|
(setq plist (plist-put plist prop (eval val)))))
|
||||||
(let ((val (plist-get plist prop)))
|
(when (file-in-directory-p (or (bound-and-true-p byte-compile-current-file)
|
||||||
(when val
|
load-file-name)
|
||||||
(plist-put plist prop (eval val)))))
|
doom-private-dir)
|
||||||
`(progn
|
(setq plist (plist-put plist :private t)))
|
||||||
,(when (and pkg-pin t)
|
`(progn
|
||||||
`(map-put package-pinned-packages ',name ,pkg-pin))
|
,(when (and pkg-pin t)
|
||||||
(map-put doom-packages ',name ',plist)
|
`(map-put package-pinned-packages ',name ,pkg-pin))
|
||||||
t)))))
|
(map-put doom-packages ',name ',plist)
|
||||||
|
(not ,pkg-disable))))
|
||||||
|
|
||||||
(defmacro packages! (&rest packages)
|
(defmacro packages! (&rest packages)
|
||||||
"A convenience macro like `package!', but allows you to declare multiple
|
"A convenience macro like `package!', but allows you to declare multiple
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue