all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joost Kremers <joostkremers@fastmail.fm>
To: emacs-devel@gnu.org
Subject: Re: Concern about new binding.
Date: Sat, 06 Feb 2021 02:32:49 +0100	[thread overview]
Message-ID: <87blcy2d65.fsf@fastmail.fm> (raw)
In-Reply-To: <5588fb258085d00c0e72@heytings.org>


On Fri, Feb 05 2021, Gregory Heytings wrote:
>>
>> Perhaps a better way to update the documented key binding conventions is 
>> to add the rule that packages should generally not create global key 
>> bindings.
>>
>
> That's another solution indeed, but IMO it is not a reasonable one.  It is 
> reasonable for a package to create global bindings,

I tend to feel differently. :-) It's reasonable for a package to *suggest*
specific global key bindings and perhaps even to provide a user option or
function to install them, but IMHO they shouldn't be created automatically.

To an extent, this is just my personal opinion, but I think there are technical
reason as well. Firstly, note that `use-package` makes it possible to delay
loading a package until it's first used. That would be moot when creating
bindings depends on loading a package. In order to install the global bindings,
the package would have to be loaded upon startup. If you'd want to lazy-load a
package, you'd have to bind the keys explicitly anyway.

Moreover, lazy-loading makes it necessary that a package that creates its own
global bindings adds a user option to disable the creation of those bindings,
because otherwise lazy-loading a package could stomp on user-defined binding.
(The only other solution would be to add a bunch of `with-eval-after-load`s to
your init file to restore your personal bindings, which is not very
user-friendly, IMHO.)

One possible way to avoid this problem could be to basically do what Magit does:
ensure that packages install their global key bindings only if they're not
already bound. Emacs could provide a macro to do this, let's say
`maybe-global-set-key`, which package authors would then be encouraged to use.
If certain keymaps were reserved for external packages, as per your proposal,
this method would also avoid the problem that `C-x g` raises now. By using
`maybe-global-set-key`, a package author would know they won't be stomping on a
user's preferred key bindings and at the same time they'd have the guarantee
that Emacs would never override their bindings, ever.

It wouldn't solve another problem, however, which is that the key bindings a
user finds in their Emacs will depend on the order in which packages are loaded.
You say that the likelihood of two external packages using conflicting key
bindings is low, but I believe this is mainly due to the fact that most external
packages follow the unspoken rule that they shouldn't create global bindings.
But if Emacs reserves certain keymaps for external packages, it's likely many
packages will start binding these keys, raising the potential for conflicts. And
when that happens, the order in which packages are loaded matters.

The only way to avoid that would be for each package to provide an option to
disable the creation of its global bindings. But the system you'd end up with is
complex and confusing for the user, I think. For each package you install, you'd
have to find out whether its key bindings override those of another package and
then make sure to load them in the correct order or set the option not to create
the bindings.

It's more straight-forward, I think, if you can just add a `require` or
`use-package` statement to your init file and add the key bindings you want. No
need to think about the place where you load the package in your init file or
whether you want to lazy-load a package.

Package authors would then simply include the code to create their proposed
key bindings in their installation instructions and every user would have the
opportunity to decide whether they want to put that code in their init file or
not. There would be no potential side effect to consider and all non-standard key
bindings would be located in one place: the user's init file.


-- 
Joost Kremers
Life has its moments



  parent reply	other threads:[~2021-02-06  1:32 UTC|newest]

Thread overview: 294+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210202134950.vybbpf3iewbymfjo.ref@Ergus>
2021-02-02 13:49 ` Concern about new binding Ergus
2021-02-02 15:21   ` Kévin Le Gouguec
2021-02-02 18:47     ` Óscar Fuentes
2021-02-02 18:53       ` Eli Zaretskii
2021-02-02 19:00         ` Óscar Fuentes
2021-02-02 19:16           ` Eli Zaretskii
2021-02-02 20:03             ` Óscar Fuentes
2021-02-02 22:14             ` [External] : " Drew Adams
2021-02-03  3:35               ` Eli Zaretskii
2021-02-03  4:44                 ` Drew Adams
2021-02-03  5:36                   ` Eli Zaretskii
2021-02-03 16:03                     ` Drew Adams
2021-02-03 16:37                       ` Stefan Monnier
2021-02-03 17:02                       ` Eli Zaretskii
2021-02-05  5:46                   ` Richard Stallman
2021-02-05  7:54                     ` Eli Zaretskii
2021-02-05 10:04                       ` Robert Pluim
2021-02-05 11:34                         ` Eli Zaretskii
2021-02-05 18:27                         ` Drew Adams
2021-02-07  5:33                         ` Richard Stallman
2021-02-07 13:22                           ` Robert Pluim
2021-02-07 14:54                             ` Ergus
2021-02-07 18:44                           ` Drew Adams
2021-02-07  5:59                         ` Yuri Khan
2021-02-05 16:55                     ` Drew Adams
2021-02-02 19:07         ` Dmitry Gutov
2021-02-02 19:14           ` Eli Zaretskii
2021-02-05  5:46         ` Richard Stallman
2021-02-05  7:11           ` Sean Whitton
2021-02-05 12:36             ` Dmitry Gutov
2021-02-05 18:31               ` [External] : " Drew Adams
2021-02-07  5:33             ` Richard Stallman
2021-02-07 18:19               ` Sean Whitton
2021-02-08  3:43                 ` Richard Stallman
2021-02-08  5:41                   ` Matt Armstrong
2021-02-08  6:06                     ` Sean Whitton
2021-02-08 15:14                       ` Eli Zaretskii
2021-02-08 18:00                         ` Sean Whitton
2021-02-08 17:56                       ` Matt Armstrong
2021-02-09  6:03                     ` Richard Stallman
2021-02-09 16:22                       ` Eli Zaretskii
2021-02-08  6:11                   ` Sean Whitton
2021-02-12  9:29               ` Jean Louis
2021-02-13  3:26                 ` Richard Stallman
2021-02-13 11:32                   ` Rmail filter, or using sieve - was " Jean Louis
2021-02-05  8:02           ` Eli Zaretskii
2021-02-05  8:46             ` Eli Zaretskii
2021-02-05 10:21               ` Robert Pluim
2021-02-07  5:43               ` Richard Stallman
2021-02-07 15:07                 ` Eli Zaretskii
2021-02-08  3:44                   ` Richard Stallman
2021-02-08 15:09                     ` Eli Zaretskii
2021-02-07  5:33             ` Richard Stallman
2021-02-02 22:07       ` [External] : " Drew Adams
2021-02-03  5:52     ` Richard Stallman
2021-02-03  6:08       ` Kévin Le Gouguec
2021-02-03  7:05         ` Eli Zaretskii
2021-02-03 16:12           ` [External] : " Drew Adams
2021-02-03 17:13             ` Eli Zaretskii
2021-02-03 18:01               ` spacibba--- via Emacs development discussions.
2021-02-03 18:14                 ` Eli Zaretskii
2021-02-03 22:16                   ` Ergus
2021-02-04  0:41                     ` Stefan Kangas
2021-02-04  7:00                       ` Ergus
2021-02-04 15:05                         ` Eli Zaretskii
2021-02-04 15:56                           ` Gregory Heytings
2021-02-04 16:28                             ` Eli Zaretskii
2021-02-04 16:42                               ` Gregory Heytings
2021-02-05  5:49                               ` Richard Stallman
2021-02-04 16:46                             ` Lars Ingebrigtsen
2021-02-04 17:55                               ` Eli Zaretskii
2021-02-04 19:29                                 ` Lars Ingebrigtsen
2021-02-04 20:23                                   ` Joost Kremers
2021-02-04 20:52                                     ` Lars Ingebrigtsen
2021-02-05 15:58                                       ` Basil L. Contovounesios
2021-02-06  9:57                                         ` Lars Ingebrigtsen
2021-02-04 21:00                                   ` Kévin Le Gouguec
2021-02-04 21:15                                     ` Thibaut Verron
2021-02-04 22:02                                       ` Kévin Le Gouguec
2021-02-12  9:17                                         ` Jean Louis
2021-02-12 17:28                                           ` Kévin Le Gouguec
2021-02-04 21:15                                   ` Gregory Heytings
2021-02-04 22:12                                     ` Lars Ingebrigtsen
2021-02-05  0:45                                       ` [External] : " Drew Adams
2021-02-05  4:13                                         ` Karl Fogel
2021-02-05  7:27                                           ` Jose A. Ortega Ruiz
2021-02-05 23:38                                             ` Karl Fogel
2021-02-06  1:36                                               ` jao
2021-02-06  2:31                                                 ` Karl Fogel
2021-02-12  9:07                                               ` Jean Louis
2021-02-12 13:27                                                 ` Dmitry Gutov
2021-02-05 18:22                                           ` Drew Adams
2021-02-12  8:53                                           ` Jean Louis
2021-02-12  9:08                                             ` Thibaut Verron
2021-02-04 22:24                                     ` Juri Linkov
2021-02-05  8:59                                       ` Lars Ingebrigtsen
2021-02-05  9:12                                         ` Juri Linkov
2021-02-06  9:56                                           ` Lars Ingebrigtsen
2021-02-06 10:09                                             ` Gregory Heytings
2021-02-06 18:24                                             ` [External] : " Drew Adams
2021-02-06 19:20                                             ` Juri Linkov
2021-02-07 12:08                                               ` Lars Ingebrigtsen
2021-02-07 12:39                                                 ` Lars Ingebrigtsen
2021-02-07 14:52                                                   ` Ergus
2021-02-07 20:44                                                     ` Lars Ingebrigtsen
2021-02-08  5:49                                                       ` Teemu Likonen
2021-02-07 18:43                                                   ` [External] : " Drew Adams
2021-02-07 23:57                                                     ` Ergus
2021-02-08  1:18                                                       ` Drew Adams
2021-02-10  8:49                                                         ` Alfred M. Szmidt
2021-02-09 23:22                                                   ` Karthik Chikmagalur
2021-02-15 18:15                                                     ` Sean Whitton
2021-02-16  2:13                                                       ` Karthik Chikmagalur
2021-02-16  5:37                                                         ` Sean Whitton
2021-02-06 19:32                                             ` Sean Whitton
2021-02-06 19:58                                               ` Eli Zaretskii
2021-02-06 20:09                                                 ` Sean Whitton
2021-02-06 20:20                                                   ` Eli Zaretskii
2021-02-06 20:28                                                     ` Sean Whitton
2021-02-06 20:37                                               ` Lars Ingebrigtsen
2021-02-06 20:44                                                 ` Gregory Heytings
2021-02-06 20:49                                                   ` Lars Ingebrigtsen
2021-02-06 21:00                                                     ` Gregory Heytings
2021-02-06 21:02                                                     ` Andreas Schwab
2021-02-06 20:59                                                 ` Sean Whitton
2021-02-05  9:14                                         ` Thibaut Verron
2021-02-05 12:39                                       ` Dmitry Gutov
2021-02-04 23:20                                     ` Jose A. Ortega Ruiz
2021-02-05  0:46                                       ` [External] : " Drew Adams
2021-02-06  2:37                                         ` Richard Stallman
2021-02-05  7:22                                       ` Lars Ingebrigtsen
2021-02-05  7:51                                         ` jao
2021-02-04 18:02                               ` Sean Whitton
2021-02-04 18:08                               ` 28.0.50; Move revert-buffer global binding into a prefix map Sean Whitton
2021-02-04 19:49                                 ` bug#46300: [External] : " Drew Adams
2021-02-07 12:31                                 ` bug#46300: " Lars Ingebrigtsen
2021-02-07 12:31                                 ` Lars Ingebrigtsen
2021-02-07 18:41                                   ` bug#46300: [External] : " Drew Adams
2021-02-07 18:41                                   ` Drew Adams
2021-02-05  5:13                               ` Concern about new binding Ergus
2021-02-06  7:28                               ` Teemu Likonen
2021-02-06  9:40                                 ` Gregory Heytings
2021-02-06  9:59                                   ` Teemu Likonen
2021-02-04 16:06                           ` [External] : " Drew Adams
2021-02-05  5:49                             ` Richard Stallman
2021-02-05  8:16                               ` Eli Zaretskii
2021-02-05  9:11                                 ` Thibaut Verron
2021-02-05 11:15                                   ` Eli Zaretskii
2021-02-05 11:35                                     ` Thibaut Verron
2021-02-05 12:55                                     ` Dmitry Gutov
2021-02-05 18:31                                     ` Drew Adams
2021-02-05 18:24                                 ` Drew Adams
2021-02-05 18:46                                   ` Eli Zaretskii
2021-02-05 19:41                                   ` Eli Zaretskii
2021-02-07  5:33                                 ` Richard Stallman
2021-02-07 15:05                                   ` Eli Zaretskii
2021-02-07 20:12                                     ` Drew Adams
2021-02-08  3:44                                     ` Richard Stallman
2021-02-05  9:21                               ` Gregory Heytings
2021-02-05  9:38                                 ` Joost Kremers
2021-02-05 10:42                                   ` Gregory Heytings
2021-02-05 18:29                                     ` [External] : " Drew Adams
2021-02-06  1:32                                     ` Joost Kremers [this message]
2021-02-06 10:59                                       ` Gregory Heytings
2021-02-06 12:08                                       ` Andreas Schwab
2021-02-05 10:51                                   ` Thibaut Verron
2021-02-05 18:30                                     ` [External] : " Drew Adams
2021-02-05 18:28                                   ` Drew Adams
2021-02-12  7:34                                     ` Jean Louis
2021-02-05 11:21                                 ` Eli Zaretskii
2021-02-05 12:07                                   ` Gregory Heytings
2021-02-05 12:39                                     ` Eli Zaretskii
2021-02-05 12:39                                     ` Thibaut Verron
2021-02-05 12:41                                       ` Thibaut Verron
2021-02-06 15:23                                     ` Stefan Kangas
2021-02-06 18:19                                       ` Ergus
2021-02-12  9:47                                       ` Jean Louis
2021-02-05 18:31                                   ` [External] : " Drew Adams
2021-02-05 19:14                                   ` Ergus via Emacs development discussions.
2021-02-05 19:43                                     ` Eli Zaretskii
2021-02-05 23:57                                     ` chad
2021-02-05 18:26                                 ` [External] : " Drew Adams
2021-02-05 20:26                                   ` Gregory Heytings
2021-02-05 20:54                                     ` Drew Adams
2021-02-05 21:41                                       ` Gregory Heytings
2021-02-05 22:43                                         ` Drew Adams
2021-02-05 23:38                                           ` Gregory Heytings
2021-02-06  0:45                                             ` Drew Adams
2021-02-06  9:29                                               ` Gregory Heytings
2021-02-06 18:09                                                 ` Drew Adams
2021-02-12  7:59                                                   ` Jean Louis
2021-02-12 17:35                                                     ` Drew Adams
2021-02-12  8:21                                                   ` Alfred M. Szmidt
2021-02-12  9:09                                                     ` Gregory Heytings
2021-02-12 11:26                                                       ` Eli Zaretskii
2021-02-12 15:11                                                       ` Alfred M. Szmidt
2021-02-12 15:30                                                         ` Eli Zaretskii
2021-02-12 16:56                                                         ` Gregory Heytings
2021-02-12 17:37                                                           ` Drew Adams
2021-02-12 18:25                                                             ` Gregory Heytings
2021-02-12 21:41                                                           ` Super key in console? Jean Louis
2021-02-14 18:43                                                           ` [External] : Re: Concern about new binding Alfred M. Szmidt
2021-02-14 19:14                                                             ` Gregory Heytings
2021-02-15 10:57                                                               ` Alfred M. Szmidt
2021-02-15 11:45                                                                 ` Gregory Heytings
2021-02-15 16:19                                                                   ` Alfred M. Szmidt
2021-02-15 13:44                                                                 ` Stefan Monnier
2021-02-12 17:36                                                     ` Drew Adams
2021-02-14 18:43                                                       ` Alfred M. Szmidt
2021-02-13  1:20                                                     ` Karthik Chikmagalur
2021-02-13 10:55                                                       ` Jean Louis
2021-02-13  8:22                                                     ` Philip Kaludercic
2021-02-07  5:43                                 ` Richard Stallman
2021-02-12  8:35                                 ` Jean Louis
2021-02-12  8:19                     ` [External] : " Jean Louis
2021-02-12 11:19                       ` Eli Zaretskii
2021-02-12  8:05                   ` Jean Louis
2021-02-04  7:39             ` Joost Kremers
2021-02-02 16:28   ` [External] : " Drew Adams
2021-02-02 16:50   ` Karl Fogel
2021-02-02 17:33     ` Invoking Magit (was: Concern about new binding) Stefan Monnier
2021-02-02 18:29       ` Invoking Magit Karl Fogel
2021-02-02 19:59         ` Stefan Monnier
2021-02-02 22:49           ` Karl Fogel
2021-02-02 17:45     ` Concern about new binding Thibaut Verron
2021-02-02 18:04       ` Sean Whitton
2021-02-02 18:52         ` Karl Fogel
2021-02-02 18:51       ` Karl Fogel
2021-02-02 20:02         ` Thibaut Verron
2021-02-02 18:56       ` Basil L. Contovounesios
2021-02-05  5:46       ` Richard Stallman
2021-02-02 22:10   ` Gregory Heytings
2021-02-02 22:22     ` [External] : " Drew Adams
2021-02-03  1:02       ` Ergus
2021-02-03  2:32         ` Drew Adams
2021-02-03  0:56     ` Ergus
2021-02-03  3:28       ` Eli Zaretskii
2021-02-03  3:58         ` Ergus
2021-02-03  5:17           ` Eli Zaretskii
2021-02-03  7:40     ` martin rudalics
2021-02-03  9:36       ` Gregory Heytings
2021-02-03 11:06         ` martin rudalics
2021-02-04  5:39           ` Richard Stallman
2021-02-03  5:52   ` Richard Stallman
2021-02-03  9:37     ` Gregory Heytings
2021-02-03 10:50       ` Robert Pluim
2021-02-03 11:12         ` Alfred M. Szmidt
2021-02-03 11:20           ` Andreas Schwab
2021-02-03 11:27             ` Alfred M. Szmidt
2021-02-03 11:43               ` Andreas Schwab
2021-02-03 12:51                 ` Alfred M. Szmidt
2021-02-03 13:15                   ` Thibaut Verron
2021-02-03 15:00                     ` Eli Zaretskii
2021-02-03 15:13                       ` Dmitry Gutov
2021-02-03 16:29                         ` [External] : " Drew Adams
2021-02-03 17:12                           ` Yuan Fu
2021-02-03 17:24                             ` Eli Zaretskii
2021-02-03 16:27                       ` Drew Adams
2021-02-03 17:17                         ` Eli Zaretskii
2021-02-04  5:46                           ` Richard Stallman
2021-02-04 15:02                             ` Eli Zaretskii
2021-02-05  5:50                               ` Richard Stallman
2021-02-05  7:12                                 ` Sean Whitton
2021-02-05  8:30                                 ` Eli Zaretskii
2021-02-03 16:23                     ` Drew Adams
2021-02-04  5:48                     ` Richard Stallman
2021-02-03 13:31                   ` Andreas Schwab
2021-02-03 13:43                     ` Alfred M. Szmidt
2021-02-03 14:10                       ` Andreas Schwab
2021-02-04  5:47                       ` Richard Stallman
2021-02-03 16:21                   ` [External] : " Drew Adams
2021-02-03 16:19               ` Drew Adams
2021-02-03 16:18             ` Drew Adams
2021-02-03 16:16           ` Drew Adams
2021-02-04 17:03           ` Juri Linkov
2021-02-03 11:31         ` Basil L. Contovounesios
2021-02-04  5:39           ` Richard Stallman
2021-02-04  8:31             ` Robert Pluim
2021-02-03 16:15         ` [External] : " Drew Adams
2021-02-04  0:41       ` Stefan Kangas
2021-02-04  5:39       ` Richard Stallman
2021-02-03 19:22     ` Sean Whitton
2021-02-04  5:41       ` Richard Stallman
2021-02-04  8:49         ` Gregory Heytings
2021-02-04  8:52           ` Lars Ingebrigtsen
2021-02-04  9:09             ` Lars Ingebrigtsen
2021-02-04  9:49               ` Gregory Heytings
2021-02-04 10:10                 ` Lars Ingebrigtsen
2021-02-04 10:20                   ` Gregory Heytings
2021-02-04 10:25                     ` Lars Ingebrigtsen
2021-02-04 12:26                       ` Gregory Heytings
2021-02-04 15:16                   ` Eli Zaretskii
2021-02-04 11:08                 ` Eli Zaretskii
2021-02-04 12:26                   ` Gregory Heytings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blcy2d65.fsf@fastmail.fm \
    --to=joostkremers@fastmail.fm \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.