Magit displays the progression of multi-step commands with popup windows. For example, pressing c brings up the commit menu, whence pressing a will invoke magit-commit-amend.

I would like to include my own command magit-commit-snapshot, and invoke it with cn.
n: Snapshot should be displayed in the commit menu, after s: Squash.

How can I do this? I can see that the bindings exist in magit-key-mode.el, but I don't see an easy way to add to them from my .emacs.


Starting with v2.1.0 you can do so using this:

(magit-define-popup-action 'magit-commit-popup
  ?n "Snapshot" 'magit-commit-snapshot)
  • 1
    @tarsius, I appreciate how you keep your answer up to date as Magit changes. – Matthew Piziak Jul 3 '15 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.