embark
embark copied to clipboard
Make embark-verbose-indicator available for C-h
For people who like which-key:
(defun embark-bindings (&optional prefix)
"Explore all current command key bindings with `completing-read'.
The selected command will be executed. The set of key bindings can
be restricted by passing a PREFIX key."
(interactive)
(let ((keymap (if prefix
(key-binding prefix)
(make-composed-keymap (current-active-maps t)))))
(unless (keymapp keymap)
(user-error "No key bindings found"))
;;(when-let (command (embark-completing-read-prompter keymap nil 'no-default))
;; (call-interactively command))
(when-let (command (let ((indicator (funcall
(if (eq embark-indicator #'embark-mixed-indicator)
#'embark-verbose-indicator
embark-indicator))))
(unwind-protect
(embark--prompt indicator keymap nil)
(funcall indicator))))
(call-interactively command))))
It seems to me that the indicator/prompter distinction is somehow not meaningful. Somehow this feels conceptually off a little bit. Can we unify indicator and prompter?
Yeah, some unification would be nice. The minimal indicator makes sense for both the keymap prompter and for the completing-read prompter, but the verbose indicator isn't really a good fit for the completing-read prompter.
Exactly. We should improve this. as you say there are these three combinations:
- completing-read+minimal
- keymap+minimal
- keymap+verbose
But one also has transitions between these three prompters.
And it should also still be possible to replace the indicator used by the keymap prompter, such that users can write their individual indicators.