Refactor some elisp out of doom.nix

Just for readability, no functional change.
This commit is contained in:
Marien Zwart 2024-04-27 14:21:34 +10:00
parent c59e95e5d9
commit 974aaf2160
No known key found for this signature in database
2 changed files with 16 additions and 12 deletions

View file

@ -0,0 +1,14 @@
(require 'package)
(with-temp-buffer
(setq default-directory (car command-line-args-left))
(dired-mode)
;; Ignore dependency extraction errors because it fails for repos not
;; containing a "proper" package (no -pkg.el, no file with the right magic
;; header). These seem common enough to be not worth allowlisting.
(let ((reqs (with-demoted-errors "Extracting dependencies: %s"
(package-desc-reqs (package-dir-info)))))
(princ
(json-encode
(mapcar #'car (seq-remove (lambda (p) (apply #'package-built-in-p p))
reqs))))))