[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: ctl-x-map key binding conventions for new major/minor modes
From: |
Tino Calancha |
Subject: |
RE: ctl-x-map key binding conventions for new major/minor modes |
Date: |
Sat, 13 May 2017 14:33:45 +0900 (JST) |
User-agent: |
Alpine 2.20 (DEB 67 2015-01-07) |
On Fri, 12 May 2017, Drew Adams wrote:
(info "(elisp) Key Binding Conventions")
Do we need a recommendation in this node about bindings with
prefix 'C-x'? There is no guidance in the node above about
this topic. Just loading a new mode shouldn't shadow some
previous C-x bindings, right?
For instance,
* timeclock.el suggests some C-x bindings in the comentary, that is,
it doesn't define these bindings by default.
* dired-x.el has the user option `dired-bind-jump' to control if
`dired-jump' must be bound or not to 'C-x C-j'.
* find-func.el has the autoloaded function `find-function-setup-keys',
which binds some commands into `ctl-x-map'.
Are you asking whether code that is distributed with Emacs
should bind keys with prefix `C-x'? That's usually discussed
and decided case by case, e.g. on this list.
Are you asking whether we should make particular recommendations
in this regard for 3rd-party code? If so, I think not.
I am asking for both.
For example, magit.el suggests the binding 'C-x g' for `magit-status'. It
doesn't establish the binding automatically, though.
Imagine one user sets that binding in her .emacs file. Now she loads
a lib `foo.el' which automatically sets a global binding
'C-x g' to `foo-whatever'.
In the examples above (timeclock, dired-x, etc) the user can easily
control such key binding collisions. It's something good for people
loading many libs.
We might add a recommendation in that info node about 'C-x ...'
as we do with 'C-c ...'.
Loading a 3rd-party library is optional. If a library binds keys
just by loading it then that should at least be made clear in the
library doc/commentary. A user can always override any bindings
that might be made by a library, but s?he should be aware of what
happens when the library is loaded or a mode is turned on.
Have you noticed an actual problem in this regard?
No yet.