Itai Y. Efrat 2021-07-31 10:41:00 +03:00
parent 7f8cba9ba0
commit d6fba19586
3 changed files with 26 additions and 11 deletions

View file

@ -218,3 +218,22 @@ If INITIAL is non-nil, use as initial input."
(setq buffers nil)
(with-current-buffer (switch-to-buffer (marker-buffer mark))
(goto-char (marker-position mark)))))
;;;###autoload
(defun +vertico/embark-which-key-indicator ()
"An embark indicator that displays keymaps using which-key.
The which-key help message will show the type and value of the
current target followed by an ellipsis if there are further
targets."
(lambda (&optional keymap targets prefix)
(if (null keymap)
(kill-buffer which-key--buffer)
(which-key--show-keymap
(if (eq (caar targets) 'embark-become)
"Become"
(format "Act on %s '%s'%s"
(caar targets)
(embark--truncate-target (cdar targets))
(if (cdr targets) "" "")))
(if prefix (lookup-key keymap prefix) keymap)
nil nil t))))