Add "unpin" section to doom/info

Important when debugging potential upstream issues.
This commit is contained in:
Henrik Lissner 2020-01-25 03:50:49 -05:00
parent a9402cfb55
commit f600605de3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 22 additions and 18 deletions

View file

@ -97,7 +97,8 @@ ready to be pasted in a bug report on github."
(cl-loop for (name . _) in package-alist
collect (format "%s" name)))
(error (format "<%S>" e)))
'("n/a"))))))))
'("n/a")))
(unpin ,@(or (get 'doom-pinned-packages 'modified) '("n/a"))))))))
;;

View file

@ -322,23 +322,26 @@ can be used one of five ways:
(unpin! (:lang python javascript) (:tools docker))
Or any combination of the above."
`(dolist (target ',targets)
(cond
((eq target t)
(setq doom-pinned-packages nil))
((or (keywordp target)
(listp target))
(cl-destructuring-bind (category . modules) (doom-enlist target)
(dolist (pkg doom-packages)
(let ((pkg-modules (plist-get (cdr pkg) :modules)))
(and (assq category pkg-modules)
(or (null modules)
(cl-loop for module in modules
if (member (cons category module) pkg-modules)
return t))
(assq-delete-all (car pkg) doom-pinned-packages))))))
((symbolp target)
(assq-delete-all target doom-pinned-packages)))))
`(progn
(put 'doom-pinned-packages 'modified
(delete-dups (append targets (get 'doom-pinned-packages 'modified))))
(dolist (target ',targets)
(cond
((eq target t)
(setq doom-pinned-packages nil))
((or (keywordp target)
(listp target))
(cl-destructuring-bind (category . modules) (doom-enlist target)
(dolist (pkg doom-packages)
(let ((pkg-modules (plist-get (cdr pkg) :modules)))
(and (assq category pkg-modules)
(or (null modules)
(cl-loop for module in modules
if (member (cons category module) pkg-modules)
return t))
(assq-delete-all (car pkg) doom-pinned-packages))))))
((symbolp target)
(assq-delete-all target doom-pinned-packages))))))
(provide 'core-packages)
;;; core-packages.el ends here