From 732d87ac3e315d0be98da8d70e231f62f3cda8fb Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 16 Sep 2022 16:25:48 +0200 Subject: [PATCH] nit: minor comment revision and refactors --- lisp/cli/help.el | 3 ++- lisp/cli/packages.el | 4 ++-- lisp/doom-cli.el | 11 +++++------ lisp/doom-modules.el | 5 +---- lisp/doom-packages.el | 6 +----- modules/editor/evil/init.el | 2 +- modules/lang/emacs-lisp/autoload.el | 2 +- 7 files changed, 13 insertions(+), 20 deletions(-) diff --git a/lisp/cli/help.el b/lisp/cli/help.el index e1398f1c2..0d58aa974 100644 --- a/lisp/cli/help.el +++ b/lisp/cli/help.el @@ -306,7 +306,8 @@ OPTIONS: (cl-defun doom-cli-help--render-commands (commands &key prefix grouped? docs? (inline? t)) (with-temp-buffer (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)) (rest (remove toplevel commands)) (drop (if prefix (length prefix) 0)) diff --git a/lisp/cli/packages.el b/lisp/cli/packages.el index a7a2b2b14..60acb07ef 100644 --- a/lisp/cli/packages.el +++ b/lisp/cli/packages.el @@ -739,8 +739,8 @@ it doesn't make sense to slack." ;; 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. (delq! "C-g" actions 'assoc) - ;; HACK These are associated with opening dired or magit, which isn't - ;; possible in tty Emacs, so... + ;; HACK: These are associated with opening dired or magit, which isn't + ;; possible in tty Emacs, so... (delq! "e" actions 'assoc) (delq! "g" actions 'assoc) (if (doom-cli-context-suppress-prompts-p doom-cli--context) diff --git a/lisp/doom-cli.el b/lisp/doom-cli.el index 49077ba0c..edb74564c 100644 --- a/lisp/doom-cli.el +++ b/lisp/doom-cli.el @@ -868,7 +868,7 @@ executable context." (cli (doom-cli-get command t)) (rcli (doom-cli-get command)) (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 (when (doom-cli-alias cli) (dolist (pcli (doom-cli-path cli)) @@ -1654,11 +1654,10 @@ ignored. \(fn COMMANDSPEC ARGLIST [DOCSTRING] &rest BODY...)" (declare (indent 2) (doc-string 3)) (let ((docstring (if (stringp (car body)) (pop body))) - (plist (let (plist) - (while (keywordp (car body)) - (push (pop body) plist) - (push (pop body) plist)) - (nreverse plist))) + (plist (cl-loop for (key val) on body by #'cddr + while (keywordp key) + collect (pop body) + collect (pop body))) options arguments bindings) (let ((type '&required)) (dolist (arg arglist) diff --git a/lisp/doom-modules.el b/lisp/doom-modules.el index 33a251a32..d92625138 100644 --- a/lisp/doom-modules.el +++ b/lisp/doom-modules.el @@ -5,9 +5,6 @@ ;; ;;; Variables -(defvar doom-init-modules-p nil - "Non-nil if `doom-initialize-modules' has run.") - (defvar doom-modules (make-hash-table :test 'equal) "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 `((fset ',fn (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 ;; If `default-directory' is a directory that doesn't ;; exist or is unreadable, Emacs throws up file-missing diff --git a/lisp/doom-packages.el b/lisp/doom-packages.el index b416d1c79..afad6cb83 100644 --- a/lisp/doom-packages.el +++ b/lisp/doom-packages.el @@ -143,11 +143,7 @@ uses a straight or package.el command directly).") (list "/emacs-jupyter.*\\.el\\'" "/evil-collection-vterm\\.el\\'" "/vterm\\.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)) + "/with-editor\\.el\\'")))) ;; diff --git a/modules/editor/evil/init.el b/modules/editor/evil/init.el index bee078b3b..79f27125d 100644 --- a/modules/editor/evil/init.el +++ b/modules/editor/evil/init.el @@ -274,7 +274,7 @@ variable for an explanation of the defaults (in comments). See Unlike `evil-collection-init', this respects `+evil-collection-disabled-list', and complains if a module is loaded too early (during startup)." (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) (if doom-init-time "" "(too early!)")) (with-demoted-errors "evil-collection error: %s" diff --git a/modules/lang/emacs-lisp/autoload.el b/modules/lang/emacs-lisp/autoload.el index 82e12cbcc..b2e071418 100644 --- a/modules/lang/emacs-lisp/autoload.el +++ b/modules/lang/emacs-lisp/autoload.el @@ -226,7 +226,7 @@ https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned" ;;;###autoload (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 `(("Section" "^[ \t]*;;;;*[ \t]+\\([^\n]+\\)" 1) ("Evil commands" "^\\s-*(evil-define-\\(?:command\\|operator\\|motion\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1)