[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6e8df96 04/21: Consolidate use of binding filters
From: |
Justin Burkett |
Subject: |
[elpa] master 6e8df96 04/21: Consolidate use of binding filters |
Date: |
Mon, 8 Jan 2018 22:46:54 -0500 (EST) |
branch: master
commit 6e8df961f4aecbbb59655ea804c62f09eb13b271
Author: Justin Burkett <address@hidden>
Commit: Justin Burkett <address@hidden>
Consolidate use of binding filters
---
which-key.el | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/which-key.el b/which-key.el
index 85714c8..348f50d 100644
--- a/which-key.el
+++ b/which-key.el
@@ -1525,19 +1525,18 @@ alists. Returns a list (key separator description)."
new-list))))
(nreverse new-list)))
-(defun which-key--get-keymap-bindings (keymap &optional filter)
+(defun which-key--get-keymap-bindings (keymap)
"Retrieve top-level bindings from KEYMAP."
(let (bindings)
(map-keymap
(lambda (ev def)
- (unless (and (functionp filter) (funcall filter ev def))
- (cl-pushnew
- (cons (key-description (list ev))
- (cond ((keymapp def) "Prefix Command")
- ((symbolp def) (copy-sequence (symbol-name def)))
- ((eq 'lambda (car-safe def)) "lambda")
- (t (format "%s" def))))
- bindings :test (lambda (a b) (string= (car a) (car b))))))
+ (cl-pushnew
+ (cons (key-description (list ev))
+ (cond ((keymapp def) "Prefix Command")
+ ((symbolp def) (copy-sequence (symbol-name def)))
+ ((eq 'lambda (car-safe def)) "lambda")
+ (t (format "%s" def))))
+ bindings :test (lambda (a b) (string= (car a) (car b)))))
keymap)
bindings))
@@ -2204,9 +2203,10 @@ is selected interactively by mode in
`minor-mode-map-alist'."
(cons keymap-name keymap)))
(t (which-key--hide-popup)))))
-(defun which-key--evil-operator-filter (_ev def)
- (and (functionp def)
- (evil-get-command-property def :suppress-operator)))
+(defun which-key--evil-operator-filter (binding)
+ (let ((def (intern (cdr binding))))
+ (and (functionp def)
+ (not (evil-get-command-property def :suppress-operator)))))
(defun which-key--show-evil-operator-keymap ()
(if which-key--inhibit-next-operator-popup
@@ -2220,8 +2220,8 @@ is selected interactively by mode in
`minor-mode-map-alist'."
which-key--using-show-operator-keymap t)
(when (keymapp keymap)
(let ((formatted-keys (which-key--get-formatted-key-bindings
- (which-key--get-keymap-bindings
- keymap 'which-key--evil-operator-filter))))
+ (which-key--get-keymap-bindings keymap)
+ #'which-key--evil-operator-filter)))
(cond ((= (length formatted-keys) 0)
(message "which-key: Keymap empty"))
((listp which-key-side-window-location)
- [elpa] master updated (a86cf29 -> 56b0fc8), Justin Burkett, 2018/01/08
- [elpa] master 917d2ba 03/21: Improve echo area note for which-key-show-major-mode, Justin Burkett, 2018/01/08
- [elpa] master 70d63a8 02/21: Add which-key-show-major-mode, Justin Burkett, 2018/01/08
- [elpa] master 6d2e17c 01/21: Update which-key version for GNU ELPA, Justin Burkett, 2018/01/08
- [elpa] master 6e8df96 04/21: Consolidate use of binding filters,
Justin Burkett <=
- [elpa] master 2934852 05/21: Mention which-key-show-major-mode in README, Justin Burkett, 2018/01/08
- [elpa] master 78a2943 08/21: Fix ordering of default replacement-alist, Justin Burkett, 2018/01/08
- [elpa] master 159f0f9 07/21: Add notes about paging commands not working with minibuffer, Justin Burkett, 2018/01/08
- [elpa] master f516b84 09/21: Add which-key-enable-extended-define-key customization option, Justin Burkett, 2018/01/08
- [elpa] master 3ff8f48 10/21: Allow null DEF in which-key--process-define-key-args, Justin Burkett, 2018/01/08
- [elpa] master 555c5c1 13/21: Demote errors in which-key--process-define-key-args, Justin Burkett, 2018/01/08
- [elpa] master 0a212c7 11/21: Fix travis build, Justin Burkett, 2018/01/08
- [elpa] master c7e5f76 18/21: Merge pull request #183 from tarsiiformes/silencio, Justin Burkett, 2018/01/08
- [elpa] master 6247cb5 16/21: Simplify implementation of define-key based replacements, Justin Burkett, 2018/01/08
- [elpa] master 1694c6d 15/21: Improve which-key--process-define-key-args, Justin Burkett, 2018/01/08