Support for repeat-map
ashlineldridge opened this issue · 2 comments
Does general.el provide any support for Emacs's repeat-map
? If not, would you consider supporting it? (I understand there is a rewrite coming which may affect appetite for new features.)
general.el does have a :repeat
property but AFAICT this only applies to Evil-style keybindings. I would love to be able to specify something like the following:
(general-def 'flymake-mode-map
:prefix "M-i"
"ld" #'flymake-show-buffer-diagnostics
"lD" #'flymake-show-project-diagnostics
"ln" #'flymake-goto-next-error :repeat t
"lp" #'flymake-goto-prev-error :repeat t)
And have the :repeat
property result in the flymake-goto-next-error
and flymake-goto-prev-error
be added to repeat-map
such that the n
and p
keys could repeatedly invoke them.
Currently I'm using general-def
(or a custom definer) to bind the keys to the regular keymap and then duplicating the repeatable keys in another keymap that I then map into repeat-map
and it feels like there should be a more efficient way of doing this using general.el (if there already is a way, please point me to it).
Thank you.
I don't plan an adding any new significant features to general but would accept a PR. There are various packages meant to simplify this (define-repeat-map, repeaters, etc.), though I haven't tried any of them and don't know if any will simplify your use case.
Currently, yes, it will have to be two steps. Maybe a slightly better alternative if the repeat map is a subset of what you want to bind under M-i l
in this example would be to first bind M-i l
to a new keymap that inherits from your repeat map or copies it and then bind only the additional keys in that.