emacs-devel
[Top][All Lists]
Advanced

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

Key bindings proposal [Was: Emacs learning curve]


From: Uday S Reddy
Subject: Key bindings proposal [Was: Emacs learning curve]
Date: Mon, 26 Jul 2010 23:01:58 +0100

Stephen J. Turnbull writes:

> It's trivial to change key bindings.  M-x local-set-key RET
> <keys-to-define> <command-name> RET and Bob's your uncle.  Or maybe
> you want a swap-keys command that would have the UI M-x swap-keys RET
> <keys1> <keys2>.  I don't have that function on the top of my head,
> but I'm pretty sure it requires at most three lines to express.

Hi Stephen, I was going to reply to this originally saying that
`local-set-key' and `global-set-key' are destructive change operations
which shouldn't be taken lightly.  They are kind of heavy duty hammers
that are looking for nails to hit on and of course everything looks
like a nail.

I thought better of it because this thread had already been too long
and wandering.  But a post in the gnu.emacs.help newsgroup today
prompted me to come back to it.  The poster says:

> For example now I just installed ruby-tests.el from emacswiki, which (I
> saw too late) unfortunately has some "global-set-keys" with combinations
> that normally I use for other things.

> Is there any way to revert back to the last global state (it might be
> useful also in other cases of cours)?

If Emacs did take key binding customization seriously, it would have
provided a whole bunch of *declarative* methods for specifying key
bindings, along with rules for how they override each other or not
override, as the need may be.  If and when a set of key bindings needs
to be installed (e.g., when a mode is entered), it would go and
compile the key bindings from all the sources, detect conflicts if
necessary, and install the right set.  The user would be protected.
The user wouldn't have to mess with mode-hooks or whatever.  

This is not an out-of-the-world idea.  Almost all customization
systems out there work this way.

Instead, Emacs acts rather like a grumpy child that believes that it
has the best key bindings already cased.  And, local-set-key and
global-set-key are like "if you really must change a key binding,
well, go right ahead.  Go and change all the key bindings if you want.
I don't care."  A totally unhelpful attitude.

Yidong asked for a specific proposal if there is one.  So, here is
mine:

    Redesign Emacs so that key bindings can be designed by end users
    or third party customizers and exchanged with each other.  It
    should be possible to change the entire set of key bindings in a
    running Emacs with the click of a button.  If there are conflicts
    between different sets of key bindings that users import, there
    should be clear rules for what to do in such a case, an analysis
    of what goes wrong and gentle feedback given to the users.

    If you think that Emacs is alredy capable of doing all of this,
    then demonstrate it by implementing a radically different set of
    key bindings.  Show the users how it can be done.

Cheers,
Uday

PS: By the way, I sort of speak from experience here.  I had RSI some
15 years ago and explored a whole bunch of options for how to change
things, including going to Vim or Viper, using speech recognition,
hand-writing etc.



reply via email to

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