branch: elpa/evil commit c306300b475555165f151d3e0ed12a99b98a65f4 Author: Axel Forsman <axels...@gmail.com> Commit: Axel Forsman <axels...@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))))