mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-24 17:00:44 -08:00
Merge pull request #183 from tarsiiformes/silencio
Define which-key--current-key-list before using it
This commit is contained in:
commit
c7e5f766d1
1 changed files with 9 additions and 9 deletions
18
which-key.el
18
which-key.el
|
|
@ -1334,15 +1334,6 @@ local bindings coming first. Within these categories order using
|
|||
(defsubst which-key--butlast-string (str)
|
||||
(mapconcat #'identity (butlast (split-string str)) " "))
|
||||
|
||||
(defun which-key--pseudo-key (key &optional use-current-prefix)
|
||||
"Replace the last key in the sequence KEY by a special symbol
|
||||
in order for which-key to allow looking up a description for the key."
|
||||
(let* ((seq (listify-key-sequence key))
|
||||
(final (intern (format "which-key-%s" (key-description (last seq))))))
|
||||
(if use-current-prefix
|
||||
(vconcat (which-key--current-key-list) (list final))
|
||||
(vconcat (butlast seq) (list final)))))
|
||||
|
||||
(defun which-key--get-replacements (key-binding &optional use-major-mode)
|
||||
(let ((alist (or (and use-major-mode
|
||||
(cdr-safe
|
||||
|
|
@ -1422,6 +1413,15 @@ which are strings. KEY is of the form produced by `key-binding'."
|
|||
map (kbd (which-key--current-key-string (car keydesc))))
|
||||
(intern (cdr keydesc)))))
|
||||
|
||||
(defun which-key--pseudo-key (key &optional use-current-prefix)
|
||||
"Replace the last key in the sequence KEY by a special symbol
|
||||
in order for which-key to allow looking up a description for the key."
|
||||
(let* ((seq (listify-key-sequence key))
|
||||
(final (intern (format "which-key-%s" (key-description (last seq))))))
|
||||
(if use-current-prefix
|
||||
(vconcat (which-key--current-key-list) (list final))
|
||||
(vconcat (butlast seq) (list final)))))
|
||||
|
||||
(defun which-key--maybe-get-prefix-title (keys)
|
||||
"KEYS is a string produced by `key-description'.
|
||||
A title is possibly returned using
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue