emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] scratch/evil 30e812bb6c 8/8: Misc minor changes


From: Stefan Monnier
Subject: [nongnu] scratch/evil 30e812bb6c 8/8: Misc minor changes
Date: Sun, 2 Jul 2023 17:38:08 -0400 (EDT)

branch: scratch/evil
commit 30e812bb6c2841cdf728f6735a90e638d5522dad
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Misc minor changes
    
    * evil-command-window.el (evil-command-window-draw-prefix):
    Mark `ignored` as, well, ignored.
    * README.md: Mention that `undo-fu` is also in NonGNU ELPA.
    * evil-core (evil-get-auxiliary-keymap): Simplify `vconcat` to `vector`.
    (evil-auxiliary-keymap-p): Unhide arg by moving it to its own line.
    * evil-macros.el (evil-define-interactive-code): Move shared `setq func`
    out of `cond`.  Move the insertion of quote around `func` to the `cond`
    so the `quote` is not incorrectly added around lambda forms.
    * evil-tests.el: Add a few FIXMEs.
---
 README.md              |  2 +-
 evil-command-window.el |  2 +-
 evil-core.el           |  5 +++--
 evil-macros.el         | 18 +++++++++---------
 evil-tests.el          |  5 +++++
 5 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/README.md b/README.md
index 198b18317c..6473ba66f2 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ file.
   * The [undo-tree](https://gitlab.com/tsc25/undo-tree) package
     (available via GNU ELPA)
   * The [undo-fu](https://gitlab.com/ideasman42/emacs-undo-fu) package
-    (available via MELPA)
+    (available via MELPA and NonGNU ELPA)
 
 * For the motions `g;` `g,` and for the last-change-register `.`, Evil
   requires the [goto-chg.el](https://github.com/emacs-evil/goto-chg)
diff --git a/evil-command-window.el b/evil-command-window.el
index 21299a2dc0..566ee3a79e 100644
--- a/evil-command-window.el
+++ b/evil-command-window.el
@@ -164,7 +164,7 @@ function to execute."
           (push result evil-search-backward-history)))
       (evil-search result forward evil-regexp-search))))
 
-(defun evil-command-window-draw-prefix (&rest ignored)
+(defun evil-command-window-draw-prefix (&rest _ignored)
   "Display `evil-command-window-cmd-key' as a prefix to the current line.
 Parameters passed in through IGNORED are ignored."
   (let ((prefix (propertize evil-command-window-cmd-key
diff --git a/evil-core.el b/evil-core.el
index f53d84c5d4..02e50e8652 100644
--- a/evil-core.el
+++ b/evil-core.el
@@ -845,7 +845,7 @@ IGNORE-PARENT are non-nil then a new auxiliary
 keymap is created even if the parent of MAP has
 one already."
   (when state
-    (let* ((key (vconcat (list (intern (format "%s-state" state)))))
+    (let* ((key (vector (intern (format "%s-state" state))))
            (parent-aux (when (and ignore-parent
                                   (keymap-parent map))
                          (lookup-key (keymap-parent map) key)))
@@ -884,7 +884,8 @@ does not already exist."
   "Whether MAP is an auxiliary keymap."
   (and (keymapp map)
        (string-match-p "Auxiliary keymap"
-                       (or (keymap-prompt map) "")) t))
+                       (or (keymap-prompt map) ""))
+       t))
 
 (defun evil-minor-mode-keymap-p (map)
   "Whether MAP is a minor-mode keymap."
diff --git a/evil-macros.el b/evil-macros.el
index a164fe6981..458a2119e2 100644
--- a/evil-macros.el
+++ b/evil-macros.el
@@ -763,19 +763,19 @@ via KEY-VALUE pairs. BODY should evaluate to a list of 
values.
     (while (keywordp (car-safe body))
       (setq properties
             (append properties (list (pop body) (pop body)))))
-    (cond
-     (args
-      (setq func `(lambda ,args
+    (setq func (cond
+                (args
+                 `(lambda ,args
                     ,@(when doc `(,doc))
-                    ,@body)))
-     ((> (length body) 1)
-      (setq func `(progn ,@body)))
-     (t
-      (setq func (car body))))
+                    ,@body))
+                ((> (length body) 1)
+                 `'(progn ,@body))
+                (t
+                 `',(car body))))
     `(eval-and-compile
        (let* ((code ,code)
               (entry (assoc code evil-interactive-alist))
-              (value (cons ',func ',properties)))
+              (value (cons ,func ',properties)))
          (if entry
              (setcdr entry value)
            (push (cons code value) evil-interactive-alist))
diff --git a/evil-tests.el b/evil-tests.el
index 455f7470c3..378619fd53 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -61,6 +61,7 @@
 ;;
 ;; This file is NOT part of Evil itself.
 
+;; FIXME: Merely loading an ELisp file should not change Emacs's config!
 (setq load-prefer-newer t)
 
 (require 'cl-lib)
@@ -8971,6 +8972,10 @@ parameter set."
 (ert-deftest evil-test-parser ()
   "Test `evil-parser'"
   (cl-flet ((parse
+             ;; FIXME: `evil-parser' is defined in `evil-ex' which is known to
+             ;; loaded at this point (thanks to (require 'evil)), but that file
+             ;; defines `evil-parser' only inside an `eval-when-compile',
+             ;; So this will misbehave if `evil-ex' has been compiled!
              (evil-parser
               '((number "[0-9]+" #'string-to-number)
                 (plus "\\+" #'intern)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]