1
Fork 0
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:
Justin Burkett 2017-12-17 13:17:13 -05:00 committed by GitHub
commit c7e5f766d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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