Skip to main content
added 44 characters in body
Source Link
tarsius
  • 26.8k
  • 4
  • 76
  • 115

Magit implements multi-key bindings in a nonstandard way: the first key runs a command that displays a “popup”, i.e. a buffer in a special mode that displays usage instructions, and the second key is bound in that special mode. That second key invokes magit-invoke-popup-action which looks up the event that invoked it in a table.

This breaks Emacs's help mechanism: if I want to know what command a key binding invokes, C-h cC-h c or C-h kC-h k isn't helpful. If I use these commands before the first key (the one that brings the popup), I get the help for the command that displays the popup (e.g. C-h c cC-h c c → “c runs the command magit-commit-popup”). If I use these commands before the second key (the one that runs in the popup buffer), I get the help for the generic second-key lookup function (e.g. c C-h c cc C-h c c → “c runs the command magit-invoke-popup-action”). And if I want to look up the key that invokes a command, C-h wC-h w truthfully tells me that the command isn't bound to any key — it's hidden behind the popup.

How can I find out Magit's key binding information from within Emacs? I am not interested in loading the documentation in Info and searching through it. I want to obtain the information automatically, following Emacs's self-documented principles, and accurately even if the documentation isn't up-to-date or I'm using customized key bindings.

Magit implements multi-key bindings in a nonstandard way: the first key runs a command that displays a “popup”, i.e. a buffer in a special mode that displays usage instructions, and the second key is bound in that special mode. That second key invokes magit-invoke-popup-action which looks up the event that invoked it in a table.

This breaks Emacs's help mechanism: if I want to know what command a key binding invokes, C-h c or C-h k isn't helpful. If I use these commands before the first key (the one that brings the popup), I get the help for the command that displays the popup (e.g. C-h c c → “c runs the command magit-commit-popup”). If I use these commands before the second key (the one that runs in the popup buffer), I get the help for the generic second-key lookup function (e.g. c C-h c c → “c runs the command magit-invoke-popup-action”). And if I want to look up the key that invokes a command, C-h w truthfully tells me that the command isn't bound to any key — it's hidden behind the popup.

How can I find out Magit's key binding information from within Emacs? I am not interested in loading the documentation in Info and searching through it. I want to obtain the information automatically, following Emacs's self-documented principles, and accurately even if the documentation isn't up-to-date or I'm using customized key bindings.

Magit implements multi-key bindings in a nonstandard way: the first key runs a command that displays a “popup”, i.e. a buffer in a special mode that displays usage instructions, and the second key is bound in that special mode. That second key invokes magit-invoke-popup-action which looks up the event that invoked it in a table.

This breaks Emacs's help mechanism: if I want to know what command a key binding invokes, C-h c or C-h k isn't helpful. If I use these commands before the first key (the one that brings the popup), I get the help for the command that displays the popup (e.g. C-h c c → “c runs the command magit-commit-popup”). If I use these commands before the second key (the one that runs in the popup buffer), I get the help for the generic second-key lookup function (e.g. c C-h c c → “c runs the command magit-invoke-popup-action”). And if I want to look up the key that invokes a command, C-h w truthfully tells me that the command isn't bound to any key — it's hidden behind the popup.

How can I find out Magit's key binding information from within Emacs? I am not interested in loading the documentation in Info and searching through it. I want to obtain the information automatically, following Emacs's self-documented principles, and accurately even if the documentation isn't up-to-date or I'm using customized key bindings.

Source Link

Key binding help for magit popup-based commands

Magit implements multi-key bindings in a nonstandard way: the first key runs a command that displays a “popup”, i.e. a buffer in a special mode that displays usage instructions, and the second key is bound in that special mode. That second key invokes magit-invoke-popup-action which looks up the event that invoked it in a table.

This breaks Emacs's help mechanism: if I want to know what command a key binding invokes, C-h c or C-h k isn't helpful. If I use these commands before the first key (the one that brings the popup), I get the help for the command that displays the popup (e.g. C-h c c → “c runs the command magit-commit-popup”). If I use these commands before the second key (the one that runs in the popup buffer), I get the help for the generic second-key lookup function (e.g. c C-h c c → “c runs the command magit-invoke-popup-action”). And if I want to look up the key that invokes a command, C-h w truthfully tells me that the command isn't bound to any key — it's hidden behind the popup.

How can I find out Magit's key binding information from within Emacs? I am not interested in loading the documentation in Info and searching through it. I want to obtain the information automatically, following Emacs's self-documented principles, and accurately even if the documentation isn't up-to-date or I'm using customized key bindings.