Magit defines a transient state
(transient-define-prefix magit-dispatch ()
"Invoke a Magit command from a list of available commands."
["Transient and dwim commands"
[("A" "Apply" magit-cherry-pick)
...
["Essential commands"
:if-derived magit-mode
...
("C-h m" " show all key bindings" describe-mode)])
I would like to add <escape>
and <q>
as key-bindings to exit the transient state.
If I edit magit.el
directly, I can achieve what I want:
(transient-define-prefix magit-dispatch ()
"Invoke a Magit command from a list of available commands."
["Transient and dwim commands"
[("A" "Apply" magit-cherry-pick)
...
["Essential commands"
:if-derived magit-mode
...
("<escape>" "quit transient state" transient-quit-one) ; <--- I added
("q" " quit transient state" transient-quit-one) ; <--- these
("C-h m" " show all key bindings" describe-mode)])
However, unless I can upstream my changes, this won't persist if I reload my packages from elpa, etc.
How can I add these key-bindings in my own init.el
so they augment the transient state magit defines?