[Top][All Lists]

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

Re: Key bindings proposal

From: Stephen J. Turnbull
Subject: Re: Key bindings proposal
Date: Tue, 27 Jul 2010 20:32:01 +0900

Stefan Monnier writes:

 > The issue with "intentions" is typically along the lines of "do you want
 > to bind `foo' to C-x C-x or do you want to bind it to the C-x key within
 > the main prefix keymap, or do you want to bind it to the repetition of
 > the key-sequence to which this main keymap is bound, or maybe only to
 > the repetition of just the last key in this key-sequence, or maybe to
 > the repetition of C-"the key above my "alt" key, or maybe you want to
 > bind it to whichever key `foobar' is bound in such-and-such-mode,
 > ..."

In most cases the intention is "bind it to a short sequence I
personally don't use otherwise, and otherwise arbitrary," I would

 > Using `remap' is one way to express such an intention.

Not really.  Remap is about deprecating a command, not really about
key sequence choice.  People who are worried about mapping issues
define whole keymaps (viz Miles's caps-lock-mode, with *one* binding
in it).  People who aren't, don't.  The question here is whether
you're willing to make life painful for people who don't pay attention
to keymaps *as maps* to force them to pay attention to keymaps:

 > I would welcome patches that try to make intentions more clear
 > (e.g. eliminate the massive hardcoding of the "C-c" prefix all over
 > the place)

Heh.  Just make define-key error on any keysequence with a prefix
bound to a keymap, unless there's a nonnil FORCE argument.

Alternatively, you could have define-key normally recurse into keymaps
the way lookup-key and *-key-binding do, unless there's a non-nil
FORCE argument.

reply via email to

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