1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-01 03:11:09 -08:00

Fix display of meta bindings in which-key-show-keymap

This commit is contained in:
Justin Burkett 2018-02-28 11:20:20 -05:00
parent 3c05294dc6
commit 0b2739a2be

View file

@ -1687,20 +1687,27 @@ ones. PREFIX is for internal use and should not be used."
(lambda (ev def)
(let* ((key (append prefix (list ev)))
(key-desc (key-description key)))
(unless (string-match-p which-key--ignore-keys-regexp key-desc)
(if (and all (keymapp def))
(unless (or (string-match-p which-key--ignore-keys-regexp key-desc)
(eq ev 'menu-bar))
(if (and (keymapp def)
(or all
;; event 27 is escape, so this will pick up meta
;; bindings and hopefully not too much more
(and (numberp ev) (= ev 27))))
(setq bindings
(append bindings
(which-key--get-keymap-bindings def t key)))
(cl-pushnew
(cons key-desc
(cond
((keymapp def) "Prefix Command")
((symbolp def) (copy-sequence (symbol-name def)))
((eq 'lambda (car-safe def)) "lambda")
((eq 'menu-item (car-safe def)) "menu-item")
(t (format "%s" def))))
bindings :test (lambda (a b) (string= (car a) (car b))))))))
(when def
(cl-pushnew
(cons key-desc
(cond
((keymapp def) "Prefix Command")
((symbolp def) (copy-sequence (symbol-name def)))
((eq 'lambda (car-safe def)) "lambda")
((eq 'menu-item (car-safe def)) "menu-item")
((stringp def) def)
(t "unknown")))
bindings :test (lambda (a b) (string= (car a) (car b)))))))))
keymap)
bindings))