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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Gregory Heytings-2

>
> My reading of the guideline on "C-c LETTER" is that a major/minor mode
> shouldn't bind C-c LETTER to a command, so that it overshadows whatever
> is bound globally to C-c LETTER. But a system like what I propose just
> generates to configuration *for* the user, in a user file in which case
> the guideline doesn't apply. That's what I mean by avoiding the need for
> an extra key-space.
>

I'm not sure your interpetation of that guideline ("Don't define 'C-c
LETTER' as a key in Lisp programs") is correct, but now at least I see
what you mean: you're more or less cheating the guideline by generating a
configuration file, after asking the user if they're okay with that,
instead of binding the key directly in the package depending on the value
of a configuration variable.  To me what you propose looks pretty close to
using customize to set a foobar-set-global-binding variable that would be
used in a call to global-set-key.

And that doesn't solve the problem that 26 letter keys is a small number.
Yes, you can also use capital letters, and yes, you can put keymaps on
these 26 letters instead of single commands.  IMO, that can't work as a
long-term solution; if it were, it would already be used, and the fact is
that it isn't, and that third-party packages prefer to use, or recommend
to use, keys that are not yet bound by Emacs.

>
> Of course, if some way could be found to reserve a prefix for
> third-party packages,
>

Again: this, to reserve prefix key(s) for third-party packages, and only
this, is what the proposal is about.

Reply | Threaded
Open this post in threaded view
|

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

Emacs - Help mailing list
Jean Louis wrote:

> If s-a is prefix key, 26 letters + 26 upper case letters +
> 10 numbers plus 32 symbols on my keyboard is 94 combinations
> multiplied by 94 possible other following keys, not counting
> possible middle suffix keys, yields ations is 8836 possible
> bindings with Super key on this keyboard.

Are you trying to compute the total number of keybindings?

What do you mean by "middle suffix keys"?

What is the Super key? A modifier like C and M? Here are
a bunch of standards:

  https://en.wikipedia.org/wiki/ISO/IEC_9995

--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal


Reply | Threaded
Open this post in threaded view
|

Re: PROPOSAL: Repurpose one key (why only one?) and reserve it for third-party packages

Gregory Heytings-2
In reply to this post by Gregory Heytings-2

>
> I'm not sure that the number of published packages necessarily means
> that 1. user install more packages over time 2. some fixed proportion of
> these require global bindings. More often than not, packages might just
> provide hooks or implement interfaces like Xref or CAPF, thus avoiding
> their own special keys.
>

Frankly, I don't understand why it is necessary to argue so much to
explain that a limit of 26 or 52 global bindings is not enough.  It's as
if your operating system forced you to have at most 26 or 52 files or
folders in each folder; of course it would be feasible to use such an
operating system, but it would be terribly impractical.  I see that, out
of the ~11K commands in Emacs core, there are currently ~450-500 commands
bound to keys in global-map (counting only the C-something, M-something
and C-M-something).  I or you may, today, not need more than 26 or 52
global bindings for external packages, we may perhaps only need 10 or 20,
but this discussion isn't about me or you, or about the current situation,
it's about finding a long-term solution to a problem, with the hope that
in the long term more and more external packages will be useful to a large
audience.  It's about making Emacs friendlier for beginners, and also for
third-party library developers by giving them a "home" in Emacs' default
keyboard bindings.