emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Invoking Magit


From: Karl Fogel
Subject: Re: Invoking Magit
Date: Tue, 02 Feb 2021 12:29:49 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

On 02 Feb 2021, Stefan Monnier wrote:
Magit should instead suggest `C-c g' as an entry point for `magit-status', though a user can bind it however they want of course. I doubt there are any Magit users who would be daunted by the need to set up a keybinding for Magit's entry point.
I think it'd make more sense to use a keybinding under the `C-x v` prefix.

Well, sure, if Emacs wants to deliberately give some keybinding space to a popular 3rd-party package like Magit, that's fine (personally I think I'd be in favor in this case, given Magit's popularity).

But Emacs makes that decision, not Magit. In other words, the crucial question is: who exactly is the subject of the verb "use" in your last sentence above? Is it Emacs, or the user?

Emacs already has conventions [1] about keyspaces reserved for users versus those reserved for packages (well, modes, and this entry point to Magit is not exactly a mode). According to those conventions:

* `C-c LETTER' is for users to do with as they like -- neither Emacs nor third-party packages should ever bind anything here.

* `C-c C-LETTER' and `C-c DIGIT' and `C-c {}<>:;' are all reserved for major modes. In this case it doesn't matter whether the mode ships with GNU Emacs or is a 3rd-party mode, since only one major mode is active at a given time. If a user has chosen the mode, then they accept that part of the keybinding space (sure, they might customize it further, but that's up to them -- they understand that they may overwrite default bindings of the mode when they do that).

* `C-c OTHER_STUFF' is for minor modes; I'll skip the details here.

So Emacs is free to reserve space under `C-x v' for Magit entry points if it wants to. That would be an unusual decision, but there's no reason not to consider it. However, when you wrote this...

I think it'd make more sense to use a keybinding under the `C-x v` prefix.

...I couldn't tell whether you meant it would make more sense for *users* to do that (i.e., by their choice), or for *Emacs* to do that (i.e., we reserve that slot for Magit).

IMHO we shouldn't recommend the former, because we already recommend to users that `C-c LETTER' is where they should do such custom bindings, and we should encourage use of that convention.

But if you meant the latter, then that's a different discussion and one worth having.

Another option would be to hijack `find-file` like PCL-CVS did, i.e. make it so `C-x C-f .../.git` opens up Magit.

(Oh my gosh, it's been *years* since I used PCL-CVS... you are bringing back memories... :-) )

I hope we wouldn't do that here. There are many reasons why someone might open up a .git directory in Dired Mode (I do it all the time) by doing `C-x C-f .../.git'.

Best regards, -Karl [1] https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]