nit: minor comment revision and refactors

This commit is contained in:
Henrik Lissner 2022-09-16 16:25:48 +02:00
parent 7ffe0df8eb
commit 732d87ac3e
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
7 changed files with 13 additions and 20 deletions

View file

@ -306,7 +306,8 @@ OPTIONS:
(cl-defun doom-cli-help--render-commands (commands &key prefix grouped? docs? (inline? t)) (cl-defun doom-cli-help--render-commands (commands &key prefix grouped? docs? (inline? t))
(with-temp-buffer (with-temp-buffer
(let* ((doom-print-indent 0) (let* ((doom-print-indent 0)
(commands (seq-group-by (fn! (if grouped? (doom-cli-prop (doom-cli-get % t) :group))) (nreverse commands))) (commands (seq-group-by (fn! (if grouped? (doom-cli-prop (doom-cli-get % t) :group)))
(nreverse commands)))
(toplevel (assq nil commands)) (toplevel (assq nil commands))
(rest (remove toplevel commands)) (rest (remove toplevel commands))
(drop (if prefix (length prefix) 0)) (drop (if prefix (length prefix) 0))

View file

@ -739,7 +739,7 @@ it doesn't make sense to slack."
;; We can't intercept C-g, so no point displaying any options for this key ;; We can't intercept C-g, so no point displaying any options for this key
;; when C-c is the proper way to abort batch Emacs. ;; when C-c is the proper way to abort batch Emacs.
(delq! "C-g" actions 'assoc) (delq! "C-g" actions 'assoc)
;; HACK These are associated with opening dired or magit, which isn't ;; HACK: These are associated with opening dired or magit, which isn't
;; possible in tty Emacs, so... ;; possible in tty Emacs, so...
(delq! "e" actions 'assoc) (delq! "e" actions 'assoc)
(delq! "g" actions 'assoc) (delq! "g" actions 'assoc)

View file

@ -868,7 +868,7 @@ executable context."
(cli (doom-cli-get command t)) (cli (doom-cli-get command t))
(rcli (doom-cli-get command)) (rcli (doom-cli-get command))
(key (doom-cli-key rcli))) (key (doom-cli-key rcli)))
(doom-log "cli-context-parse: found %s" command) (doom-log "cli-context-parse: found command %s" command)
;; Show warnings depending on CLI plists ;; Show warnings depending on CLI plists
(when (doom-cli-alias cli) (when (doom-cli-alias cli)
(dolist (pcli (doom-cli-path cli)) (dolist (pcli (doom-cli-path cli))
@ -1654,11 +1654,10 @@ ignored.
\(fn COMMANDSPEC ARGLIST [DOCSTRING] &rest BODY...)" \(fn COMMANDSPEC ARGLIST [DOCSTRING] &rest BODY...)"
(declare (indent 2) (doc-string 3)) (declare (indent 2) (doc-string 3))
(let ((docstring (if (stringp (car body)) (pop body))) (let ((docstring (if (stringp (car body)) (pop body)))
(plist (let (plist) (plist (cl-loop for (key val) on body by #'cddr
(while (keywordp (car body)) while (keywordp key)
(push (pop body) plist) collect (pop body)
(push (pop body) plist)) collect (pop body)))
(nreverse plist)))
options arguments bindings) options arguments bindings)
(let ((type '&required)) (let ((type '&required))
(dolist (arg arglist) (dolist (arg arglist)

View file

@ -5,9 +5,6 @@
;; ;;
;;; Variables ;;; Variables
(defvar doom-init-modules-p nil
"Non-nil if `doom-initialize-modules' has run.")
(defvar doom-modules (make-hash-table :test 'equal) (defvar doom-modules (make-hash-table :test 'equal)
"A hash table of enabled modules. Set by `doom-initialize-modules'.") "A hash table of enabled modules. Set by `doom-initialize-modules'.")
@ -377,7 +374,7 @@ If ALL-P is `real', only return *real"
(use-package-concat (use-package-concat
`((fset ',fn `((fset ',fn
(lambda (&rest _) (lambda (&rest _)
(doom-log "Loading deferred package %s from %s" ',name ',fn) (doom-log "use-package: lazy loading %s from %s" ',name ',fn)
(condition-case e (condition-case e
;; If `default-directory' is a directory that doesn't ;; If `default-directory' is a directory that doesn't
;; exist or is unreadable, Emacs throws up file-missing ;; exist or is unreadable, Emacs throws up file-missing

View file

@ -143,11 +143,7 @@ uses a straight or package.el command directly).")
(list "/emacs-jupyter.*\\.el\\'" (list "/emacs-jupyter.*\\.el\\'"
"/evil-collection-vterm\\.el\\'" "/evil-collection-vterm\\.el\\'"
"/vterm\\.el\\'" "/vterm\\.el\\'"
"/with-editor\\.el\\'"))) "/with-editor\\.el\\'"))))
;; Remove unwanted $EMACSDIR/eln-cache/ directory.
(cl-callf2 delete (file-name-concat doom-emacs-dir "eln-cache/")
native-comp-eln-load-path))
;; ;;

View file

@ -274,7 +274,7 @@ variable for an explanation of the defaults (in comments). See
Unlike `evil-collection-init', this respects `+evil-collection-disabled-list', Unlike `evil-collection-init', this respects `+evil-collection-disabled-list',
and complains if a module is loaded too early (during startup)." and complains if a module is loaded too early (during startup)."
(unless (memq (or (car-safe module) module) disabled-list) (unless (memq (or (car-safe module) module) disabled-list)
(doom-log "Initialized evil-collection-%s %s" (doom-log "editor:evil: loading evil-collection-%s %s"
(or (car-safe module) module) (or (car-safe module) module)
(if doom-init-time "" "(too early!)")) (if doom-init-time "" "(too early!)"))
(with-demoted-errors "evil-collection error: %s" (with-demoted-errors "evil-collection error: %s"

View file

@ -226,7 +226,7 @@ https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned"
;;;###autoload ;;;###autoload
(defun +emacs-lisp-extend-imenu-h () (defun +emacs-lisp-extend-imenu-h ()
"Improve imenu support in `emacs-lisp-mode', including recognition for Doom's API." "Improve imenu support in `emacs-lisp-mode' for Doom's APIs."
(setq imenu-generic-expression (setq imenu-generic-expression
`(("Section" "^[ \t]*;;;;*[ \t]+\\([^\n]+\\)" 1) `(("Section" "^[ \t]*;;;;*[ \t]+\\([^\n]+\\)" 1)
("Evil commands" "^\\s-*(evil-define-\\(?:command\\|operator\\|motion\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1) ("Evil commands" "^\\s-*(evil-define-\\(?:command\\|operator\\|motion\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1)