Eval unpin! logic at runtime

This commit is contained in:
Henrik Lissner 2020-01-15 00:31:12 -05:00
parent 4b2a9c8c38
commit 835f3f2c53
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -317,20 +317,20 @@ can be used one of five ways:
(unpin! (:lang python) (:tools docker)) (unpin! (:lang python) (:tools docker))
Or any combination of the above." 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))
((or (keywordp target) ((or (keywordp target)
(listp target)) (listp target))
(cl-destructuring-bind (category &optional module) (doom-enlist 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)
(eq (cdr mod) module)) (eq (cdr mod) module))
(assq-delete-all (car pkg) doom-pinned-packages)))))) (assq-delete-all (car pkg) doom-pinned-packages))))))
((symbolp target) ((symbolp target)
(assq-delete-all target doom-pinned-packages))))) (assq-delete-all target doom-pinned-packages)))))
(provide 'core-packages) (provide 'core-packages)
;;; core-packages.el ends here ;;; core-packages.el ends here