aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Mendler2020-12-15 23:49:28 +0100
committerDaniel Mendler2020-12-15 23:58:39 +0100
commit3908719ff2cf45ef886fa484af0cf8a81e95c9aa (patch)
treec870ad4abd1415f8cbdd94cdfd0f820174ae9a9b
parentca268fd313d3fb2bd03a8b5e4bdcca675ce58ca7 (diff)
downloademacs-3908719ff2cf45ef886fa484af0cf8a81e95c9aa.tar.gz
emacs-3908719ff2cf45ef886fa484af0cf8a81e95c9aa.zip
simplify pseudo key
-rw-r--r--which-key.el11
1 files changed, 4 insertions, 7 deletions
diff --git a/which-key.el b/which-key.el
index de1aa678cfe..b2635ea6ad9 100644
--- a/which-key.el
+++ b/which-key.el
@@ -677,12 +677,12 @@ update.")
677(defvar which-key--ignore-non-evil-keys-regexp 677(defvar which-key--ignore-non-evil-keys-regexp
678 (eval-when-compile 678 (eval-when-compile
679 (regexp-opt '("mouse-" "wheel-" "remap" "drag-" "scroll-bar" 679 (regexp-opt '("mouse-" "wheel-" "remap" "drag-" "scroll-bar"
680 "select-window" "switch-frame" "which-key-")))) 680 "select-window" "switch-frame" "which-key"))))
681(defvar which-key--ignore-keys-regexp 681(defvar which-key--ignore-keys-regexp
682 (eval-when-compile 682 (eval-when-compile
683 (regexp-opt '("mouse-" "wheel-" "remap" "drag-" "scroll-bar" 683 (regexp-opt '("mouse-" "wheel-" "remap" "drag-" "scroll-bar"
684 "select-window" "switch-frame" "-state" 684 "select-window" "switch-frame" "-state"
685 "which-key-")))) 685 "which-key"))))
686 686
687(make-obsolete-variable 'which-key-prefix-name-alist nil "2016-10-05") 687(make-obsolete-variable 'which-key-prefix-name-alist nil "2016-10-05")
688(make-obsolete-variable 'which-key-prefix-title-alist nil "2016-10-05") 688(make-obsolete-variable 'which-key-prefix-title-alist nil "2016-10-05")
@@ -1595,11 +1595,8 @@ which are strings. KEY is of the form produced by `key-binding'."
1595(defun which-key--pseudo-key (key &optional prefix) 1595(defun which-key--pseudo-key (key &optional prefix)
1596 "Replace the last key in the sequence KEY by a special symbol 1596 "Replace the last key in the sequence KEY by a special symbol
1597in order for which-key to allow looking up a description for the key." 1597in order for which-key to allow looking up a description for the key."
1598 (let* ((seq (listify-key-sequence key)) 1598 (let ((seq (listify-key-sequence key)))
1599 (final (intern (format "which-key-%s" (key-description (last seq)))))) 1599 (vconcat (or prefix (butlast seq)) (vector 'which-key (last seq)))))
1600 (if prefix
1601 (vconcat prefix (list final))
1602 (vconcat (butlast seq) (list final)))))
1603 1600
1604(defun which-key--maybe-get-prefix-title (keys) 1601(defun which-key--maybe-get-prefix-title (keys)
1605 "KEYS is a string produced by `key-description'. 1602 "KEYS is a string produced by `key-description'.