1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-28 10:51:29 -08:00

Provide alternate prefix-title for echo area

This commit is contained in:
justbur 2015-11-18 22:00:14 -05:00
parent 6b5ca75b64
commit c6abc78b58

View file

@ -1123,14 +1123,17 @@ An empty stiring is returned if no title exists."
(let* ((alist which-key-prefix-title-alist)
(res (assoc key-lst alist))
(mode-alist (assq major-mode alist))
(mode-res (when mode-alist (assoc key-lst mode-alist))))
(mode-res (when mode-alist (assoc key-lst mode-alist)))
(alternate (when (symbolp (key-binding (apply #'vector key-lst)))
(symbol-name (key-binding (apply #'vector key-lst))))))
(cond (mode-res (cdr mode-res))
(res (cdr res))
((and (eq which-key-show-prefix 'echo) alternate)
alternate)
((and (member which-key-show-prefix '(bottom top))
(eq which-key-side-window-location 'bottom)
echo-keystrokes)
(if (symbolp (key-binding (apply #'vector key-lst)))
(symbol-name (key-binding (apply #'vector key-lst)))
(if alternate alternate
(concat "Following " (key-description key-lst))))
(t "")))
"Top-level bindings"))