emacs-devel
[Top][All Lists]
Advanced

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

Re: dired-jump keybinding and autoload


From: Stephen J. Turnbull
Subject: Re: dired-jump keybinding and autoload
Date: Mon, 24 May 2010 14:03:32 +0900

Lennart Borgman writes:

 > You have a point there of course. I get too upset when this conflict
 > is ignored.. ;-)

Well, you're just going to have to deal with that.  I sympathize with
your pain, but not with your position.  I prefer X-style GUI and Emacs
keybindings myself. :-)  Since that seems to the be majority position
in Emacs core, I think the only solution for people who want CUA
bindings (or other nontraditional maps, such as vi[1]) is going to be
a really excellent keymap skinning method that allows even more
convenient switching (and maintenance of personal variants) than
cua.el or viper.

 > There are some thing there I do not understand:
 > 
 > -. Does all C-x bindings go into Control-X-prefix? How does that work?

Yes and no.  The basic answer is "yes, because the control-X prefix
map is bound early, and the keybinding code automatically searches
through the maps found along the keystroke sequence, and puts bindings
in the leaf-most map it finds."

The full answer is "theoretically, not necessarily, because you can
unbind C-x in a mode before binding C-x sequences, but in practice
only someone intent on sabotage would do that in an editing mode".  I
can't recall ever typing C-x C-f and getting something other than
find-file (including errors), or C-x b and getting something other
than switch-to-buffer, so I would guess that even rather specialized
modes pretty much all preserve the binding of control-x to that
keymap.

 > - Why is Control-X-prefix a full keymap (and not a sparse dito)?

Saves some consing, that's all.  Eg, in XEmacs they're both resizable
hashtables, make-sparse-keymap starts with room for 8 entries (and the
hashtable implementation rounds up to 19), while make-keymap makes a
much bigger one (at least 60 entries which rounds up to 79 -- not
quite big enough, my current session has 82 entries :-) by default.
Otherwise the functionality of both kinds of keymap is identical.

In Emacs the implementation is different, but I would imagine that the
rationale is the same, a tradeoff of consing vs a certain amount of
space, and the API has exactly the same semantics for both kinds of
hashtable.


Footnotes: 
[1]  For values of tradition == Emacs', of course!





reply via email to

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