Polish unpin! user story and docstring

This commit is contained in:
Henrik Lissner 2020-01-14 23:05:17 -05:00
parent dc4df47842
commit 4b2a9c8c38
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -306,21 +306,24 @@ Only use this macro in a module's (or your private) packages.el file."
(defmacro unpin! (&rest targets) (defmacro unpin! (&rest targets)
"Unpin packages in TARGETS. "Unpin packages in TARGETS.
Elements in TARGETS can be package names (symbols), a list consisting of
(CATEGORY MODULE) where MODULE is optional, or the boolean `t'.
Each package in this list is unpinned, which means its latest version will be This unpins packages, so that 'doom upgrade' downloads their latest version. It
installed next time you run 'doom upgrade'. If you specify a (CATEGORY), all can be used one of five ways:
packages in all modules in that category will be unpinned. If you specify
(CATEGORY MODULE), only packages in that particular module will be unpinned.
Lastly, a value of `t' means unpin all packages." + To disable pinning wholesale: (unpin! t)
+ To unpin individual packages: (unpin! packageA packageB ...)
+ To unpin all packages in a group of modules: (unpin! :lang :tools ...)
+ To unpin packages in individual modules:
(unpin! (:lang python) (:tools docker))
Or any combination of the above."
(dolist (target targets) (dolist (target targets)
(cond (cond
((eq target t) ((eq target t)
(setq doom-pinned-packages nil)) (setq doom-pinned-packages nil))
((listp target) ((or (keywordp target)
(cl-destructuring-bind (category &optional module) target (listp target))
(cl-destructuring-bind (category &optional module) (doom-enlist target)
(dolist (pkg doom-packages) (dolist (pkg doom-packages)
(when-let (mod (assq category (plist-get (cdr pkg) :modules))) (when-let (mod (assq category (plist-get (cdr pkg) :modules)))
(and (or (null module) (and (or (null module)