FYI: repeat `:hints` coming
Emacs 30 will allow specifying :hints with the repeat maps, so a short bit of text can be displayed with the repeat keys. See bug 70576.
Emacs 30 will allow specifying
:hintswith the repeat maps, so a short bit of text can be displayed with the repeat keys. See bug @.***/).
Thanks for the heads up! I've made a note to add support for it after the RC is out.
@jdtsmith I finally got around to this, and it's actually not clear how to incorporate this feature into repeat-help. Is the idea that the repeat-help keymap indicator should show the hint (from :hints) instead of the command name?
Cool. It shows the binding and the hint.
`:hints' is a list of cons pairs where car is a command and cdr is a string that is displayed alongside of the repeatable key in the echo area.
What have you tried? Here's an example I just worked up:
(defun my/a ()
(interactive)
(insert "A\n"))
(defun my/b ()
(interactive)
(insert "B\n"))
(defvar-keymap myab-repeat-map
:repeat (:hints ((my/a . "More A") (my/b . "More B")))
"a" 'my/a
"b" 'my/b)
(progn
(put 'my/a 'repeat-map 'myab-repeat-map)
(put 'my/b 'repeat-map 'myab-repeat-map)
(bind-key "H-a" #'my/a)
(bind-key "H-b" #'my/b))
If you want to pull the 'repeat-hint property which defvar-keymap sets from the plist of each of your command symbols, you could show those too?