help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: PROPOSAL: Repurpose one key and reserve it for third-party packages


From: Gregory Heytings
Subject: Re: PROPOSAL: Repurpose one key and reserve it for third-party packages
Date: Sat, 13 Feb 2021 15:02:18 +0000



Sorry for protracting the conversation, I just think the interpretation of the guideline is important.


Not for the proposal itself.

Indeed, my understanding of the "spirit of the law" is different: my understanding is that no code in a library should bind C-c LETTER key, conditionally or not, and that these keys are strictly reserved for users, who have to explicitly bind them in their init file.

This seems to be more of a literal interpretation, unless I'm missing something.


Yes, indeed.

AFAIU, this is also how the author of Magit understands that guideline: Magit binds three keys globally unless magit-define-global-key-bindings, whose default value is t, has been set to nil, and only recommends in the docstring to bind "C-c g". With your understanding of the guideline, Magit could have added a third possible to magit-define-global-key-bindings, say 'best, with which the "C-c g" binding would have been created automatically.

No, because the user is not asked, and I have to add extra configuration, to prevent Magit from changing my environment.


The point here is that the three values for magit-define-global-key-bindings would have resulted in three behaviors: nil => do not bind any key, t => bind keys but not in C-c, 'best => bind keys including one in C-c. The author of Magit did not do this, so my guess (it's just a guess, I could be wrong) is that he also has a literal interpretation of the guideline.


This all boils down to the question of what's better: Opt-in or Out-out -- I have argued that these kind of things (modes, binding global keys, hook, ...) should always be opt-in.


This question comes closer to the proposal, I understand your point, and I do not agree. As I said, you and me are developers, we know Emacs, we know how it works, we know how to do things. Newcomers are perhaps not even developers, and even those who are shouln't have to do such things, just as you shouldn't have to add some JavaScript code in a configuration file of your browser to enable an extension. Here's how the author of Magit explained why he added global bindings:

"Some [...] beginners will initially have a low threshold for things not working out of the box and I don't want to (continue to) scare them off by immediately forcing them to learn how to add key bindings and what that even means. There's a lot of talk about making Emacs friendlier for beginners and this is a small step in that direction." [1]

The proposal goes exactly into that same direction, and has the same motivation.

[1] https://github.com/magit/magit/pull/4237#issuecomment-723495053



reply via email to

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