[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/which-key 2444833 12/32: Fix menu-item bidning retrieva
From: |
ELPA Syncer |
Subject: |
[elpa] externals/which-key 2444833 12/32: Fix menu-item bidning retrieval |
Date: |
Wed, 30 Jun 2021 18:57:28 -0400 (EDT) |
branch: externals/which-key
commit 244483334044ebd87a10608eae124111c8837823
Author: Justin Burkett <justin@burkett.cc>
Commit: Justin Burkett <justin@burkett.cc>
Fix menu-item bidning retrieval
---
which-key.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/which-key.el b/which-key.el
index 55e65b8..ebed572 100644
--- a/which-key.el
+++ b/which-key.el
@@ -1745,6 +1745,14 @@ Requires `which-key-compute-remaps' to be non-nil"
(copy-sequence (symbol-name remap))
(copy-sequence (symbol-name binding)))))
+(defun which-key--get-menu-item-binding (def)
+ "Retrieve binding for menu-item"
+ ;; see `keymap--menu-item-binding'
+ (let* ((binding (nth 2 def))
+ (plist (nthcdr 3 def))
+ (filter (plist-get plist :filter)))
+ (if filter (funcall filter binding) binding)))
+
(defun which-key--get-keymap-bindings-1
(keymap start &optional prefix filter all ignore-commands)
"See `which-key--get-keymap-bindings'."
@@ -1772,14 +1780,17 @@ Requires `which-key-compute-remaps' to be non-nil"
(which-key--get-keymap-bindings-1
keymap bindings key nil all ignore-commands)))
(def
- (let ((binding
+ (let* ((def (if (eq 'menu-item (car-safe def))
+ (which-key--get-menu-item-binding def)
+ def))
+ (binding
(cons key-desc
(cond
((keymapp def) "prefix")
((symbolp def) (which-key--compute-binding def))
((eq 'lambda (car-safe def)) "lambda")
((eq 'menu-item (car-safe def))
- (keymap--menu-item-binding def))
+ (which-key--get-menu-item-binding def))
((stringp def) def)
((vectorp def) (key-description def))
((consp def) (car def))
- [elpa] externals/which-key 8a558e6 06/32: Update tests, (continued)
- [elpa] externals/which-key 8a558e6 06/32: Update tests, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key e42d946 11/32: Fix prefix sorting, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key fc88551 05/32: Remove pseudo binding stuff, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key 465d2fb 10/32: Fix add-keymap-based-bindings and associated test, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key 6ae80f5 22/32: Try without cask, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key d621634 19/32: Try with cask again, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key a55b908 04/32: Alternative approach to retrieving bindings (WIP), ELPA Syncer, 2021/06/30
- [elpa] externals/which-key 1f9c37d 03/32: Merge pull request #305 from tarsiiformes/first-line, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key 4e592ed 08/32: Fix type usage and arglists for new functions, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key d6b56f3 13/32: Fix detection of named prefix bindings, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key 2444833 12/32: Fix menu-item bidning retrieval,
ELPA Syncer <=
- [elpa] externals/which-key 7d344ce 17/32: Fix test, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key 300c098 16/32: Update README, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key 3f76f51 20/32: Fix which-key--group-p, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key 8b707ef 15/32: Make enable-extended-define-key obsolete, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key b83c0de 27/32: Clean up which-key--maybe-replace, ELPA Syncer, 2021/06/30
- [elpa] externals/which-key 7abe54f 31/32: Handle closure definition type, ELPA Syncer, 2021/06/30