[Top][All Lists]

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

Re: Function for deleting a key binding in a sparse keymap

From: Lennart Borgman
Subject: Re: Function for deleting a key binding in a sparse keymap
Date: Sun, 11 Dec 2005 03:16:58 +0100
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Stefan Monnier wrote:

As Kim noticed, this is wrong: this translation is applied at the very end
by the "self-insertion" function (and only if the function was correctly
fixed to take this table into account).
Thanks, I have already moved it.

Actually, minibuffer-local-map is nothing more than the keymap used as "local
keymap" in the minibuffers.  So it shouldn't be in this list.
Then maybe it should be placed in the item about "local keymap"?

Actually the above two are mutually exclusive: if a `local-map' property is
found, it's used instead of the local keymap.
Thanks, I have change that.

This also applies to non-ASCII sequences.  But it only applies if no binding
was found yet.
Ok, I have changed that. But then I think the doc string for function-key-map is wrong.

Actually key-translation-map is different because it applies even if the
untranslated sequence already had a binding.  Also those mappings are not
I did not notice that it could override keymaps. Would it be correct to place this item as the FIRST-MAP in the list, before special-event-map? I placed it there now.
@subsection Finding the keymap to use

The list below describes step by step how Emacs finds a keymap from a
given key sequence. As soon as a hit is found in any keymap (see
@ref{Key Lookup}) then if the keymap entry is a function the search is
over. However if the keymap entry is a variable symbol or a string
then Emacs restarts with the variable symbol value or the string from

The keymap entry could also be a keymap. In that case the next event
is looked up in that keymap. (But what happens if there is no hit
there, I can not find any documentation on this???)

@emph{Note 1:} When Emacs finally find a function symbol through this
process it also checks for command remapping. This just replaces the
function symbol with another. It is not recursive.

@emph{Note 2:} Characters that are bound to @code{self-insert-command}
are translated according to @code{translation-table-for-input} before

@emph{Note 3:} You may find the function @code{current-active-maps}
useful when looking into this.

@table @asis
First apply @code{extra-keyboard-modifiers} mask to each keyboard
character read.
@end table

@itemize @bullet
Each character read from the keyboard may be translated according to

Translate meta characters according to @code{meta-prefix-char} to a
two character sequence.

For example, this normally maps M-x into ESC x.
@end example
@end itemize

@table @asis
@item FIRST-MAP:
The key sequence is first searched for in @code{key-translation-map}
which transforms it to a new key sequences if there is a hit.
@end table

@itemize @bullet
Look in @code{special-event-map}.

For example, this is where the @code{delete-frame} event is handled.
@end example

If overriding-terminal-local-map look in this. Then go to GLOBAL.

This is for example used by @code{Incremental Search}.
@end example

If overriding-local-map look in this. Then go to GLOBAL.

Is there a "keymap" property of the text or overlay at point?

Look for minor mode keymaps in @code{emulation-mode-map-alists}.

For example, this is used by @code{cua-mode} and @code{viper}.
@end example

Look for minor mode keymaps in @code{minor-mode-overriding-map-alist}

Look for minor mode keymaps in @code{minor-mode-map-alist}.

Is there a @code{local-map} property of the text or overlay at point?
Otherwise is there a "local keymap" (those are for major modes)?  In
the minibuffer some special maps are used.  If using
@code{read-from-minibuffer} (directly or indirectly) then look in the
keymap given as parameter then look in this. Otherwise look in
@code{minibuffer-local-map}.  If using @code{read-no-blanks-input} to
read from minibuffer then look in @code{minibuffer-local-ns-map} first
and then @code{minibuffer-local-map}.
@end itemize

@table @asis
@item GLOBAL:
Look in the "current global keymap". (This is returned by
@code{current-global-map} and may be different from @code{global-map},
see @code{use-global-map}.)
@end table

@itemize @bullet
Look in @code{function-key-map}. This map transforms to a new key

This is for example used when running Emacs on a VT-100 terminal.
Such terminal sends ASCII key sequences for function keys which are
translated into a more general format Emacs uses.  For example the
sequence @code{ESC O P} is translated to [f1].
@end example

If any transformation was made by @code{function-key-map} then take
the new sequence and go back to FIRST-MAP.
@end itemize

reply via email to

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