unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Key bindings proposal [Was: Emacs learning curve]
@ 2010-07-29  0:08 Noah Lavine
  2010-07-29 11:26 ` Uday S Reddy
  0 siblings, 1 reply; 6+ messages in thread
From: Noah Lavine @ 2010-07-29  0:08 UTC (permalink / raw)
  To: u.s.reddy; +Cc: emacs-devel

Hello,

I am writing because I am trying to understand exactly what the keybindings proposal requires. As I understand it, this chain of events will produce an undesired result:

1. Global keymap says "C-y" -> yank
2. You map "C-z" -> yank and send "C-y" to something else
3. Gzip major mode says "C-z" -> compress and "C-y" -> gzip-special-yank

At this point typing "C-z" runs 'compress' and typing "C-y" runs 'gzip-special-yank', whereas the desired result was that "C-z" would be gzip-special-yank and "C-y" would be compress, because you have indicated your preference that "C-z" be used for yank instead of "C-y".

Remap would not accomplish this (at least not by itself), because there is no standard command analogous to 'compress' that gzip-mode should have remapped. However, as long as there is a command anywhere in the keymap that is analogous to yank, then "C-z" should have been mapped to that, and its keybinding moved as necessary (perhaps to "C-y").

Is this an accurate statement of the idea?

Noah


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Key bindings proposal [Was: Emacs learning curve]
@ 2010-07-26 22:01 Uday S Reddy
  2010-07-27  3:17 ` Stephen J. Turnbull
  0 siblings, 1 reply; 6+ messages in thread
From: Uday S Reddy @ 2010-07-26 22:01 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: Uday S. Reddy, Teemu Likonen, emacs-devel

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.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-29 14:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29  0:08 Key bindings proposal [Was: Emacs learning curve] Noah Lavine
2010-07-29 11:26 ` Uday S Reddy
2010-07-29 12:21   ` Key bindings proposal joakim
2010-07-29 14:16     ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2010-07-26 22:01 Key bindings proposal [Was: Emacs learning curve] Uday S Reddy
2010-07-27  3:17 ` Stephen J. Turnbull

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).