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

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

[nongnu] elpa/evil c306300b47 1/3: Fix evil-set-leader with nil state ar


From: ELPA Syncer
Subject: [nongnu] elpa/evil c306300b47 1/3: Fix evil-set-leader with nil state argument
Date: Thu, 12 Jan 2023 05:59:05 -0500 (EST)

branch: elpa/evil
commit c306300b475555165f151d3e0ed12a99b98a65f4
Author: Axel Forsman <axelsfor@gmail.com>
Commit: Axel Forsman <axelsfor@gmail.com>

    Fix evil-set-leader with nil state argument
    
    The predicate (listp state) is true also for the value nil of state,
    meaning the correct clause with all-states was never considered.
    
    Closes #1383
---
 evil-core.el | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/evil-core.el b/evil-core.el
index d773b2e5d8..b43c1545d1 100644
--- a/evil-core.el
+++ b/evil-core.el
@@ -948,12 +948,10 @@ KEY should be in the form produced by `kbd'. STATE is one 
of
 all of the above. If LOCALLEADER is non-nil, set the local leader
 instead."
   (let* ((all-states '(normal insert visual replace operator motion emacs))
-         (states (cond ((listp state) state)
-                       ((member state all-states) (list state))
-                       ((null state) all-states)
-                       ;; Maybe throw error here
+         (states (cond ((null state) all-states)
+                       ((consp state) state)
                        (t (list state))))
-         (binding (if localleader 'evil-send-localleader 'evil-send-leader)))
+         (binding (if localleader #'evil-send-localleader #'evil-send-leader)))
     (dolist (state states)
       (evil-global-set-key state key binding))))
 



reply via email to

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