General minor refactor & comment updates

This commit is contained in:
Henrik Lissner 2018-05-20 15:23:37 +02:00
parent ddadb79952
commit f2c02e32c8
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 29 additions and 30 deletions

View file

@ -75,8 +75,7 @@ kills the buffer. If FORCE-P, force the deletion (don't ask for confirmation)."
((not (or force-p (y-or-n-p (format "Really delete %s?" fbase))))
(message "Aborted")
nil)
(t
(unwind-protect
((unwind-protect
(progn (delete-file path) t)
(let ((short-path (file-relative-name path (doom-project-root))))
(if (file-exists-p path)

View file

@ -3,9 +3,6 @@
(load! cache)
;;; Private functions
(defsubst doom--sort-alpha (it other)
(string-lessp (symbol-name (car it))
(symbol-name (car other))))
(defun doom--packages-choose (prompt)
(let ((table (cl-loop for pkg in package-alist
@ -365,7 +362,8 @@ package.el as appropriate."
"QUELPA")
(t
"ELPA"))))
(sort (cl-copy-list packages) #'doom--sort-alpha)
(cl-sort (cl-copy-list packages) #'string-lessp
:key #'car)
"\n")))))
(error "Aborted!"))
@ -400,7 +398,8 @@ package.el as appropriate."
(doom-initialize-packages)
(print! "Looking for outdated packages...")
(doom-refresh-packages-maybe doom-debug-mode)
(let ((packages (sort (doom-get-outdated-packages) #'doom--sort-alpha)))
(let ((packages (cl-sort (cl-copy-list (doom-get-outdated-packages)) #'string-lessp
:key #'car)))
(cond ((not packages)
(print! (green "Everything is up-to-date"))
nil)
@ -411,7 +410,7 @@ package.el as appropriate."
(length packages)
(let ((max-len
(or (car (sort (mapcar (lambda (it) (length (symbol-name (car it)))) packages)
(lambda (it other) (> it other))))
#'>))
10)))
(mapconcat
(lambda (pkg)