emacs-devel
[Top][All Lists]
Advanced

[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: Fri, 09 Dec 2005 21:12:40 +0100
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

Richard M. Stallman wrote:

   *****************************************************************************
   How to find the keymap for a given key sequence in a buffer
   ===========================================================

It would be good to put this list into the Active Keymaps node
in lispref/keymaps.texi.
I am glad you appreciate it. However there was a bit more to add. I got some tips from Kim and made a new version. There is a question in this about when the keymap entry is a keymap.

*********************************************************************************

*****************************************************************************
How to find the keymap for a given key sequence in a buffer
===========================================================

Go through the list below step by step. As soon as a hit is found in
any keymap (see KeyLookup) you normally are ready. However if the
keymap entry is a variable symbol or a string then you must restart
with the variable symbol value or the string from FIRST-MAP.

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???)

Note: When you finally find a function symbol through this process you
  must also check for command remapping. This just replaces the
  function symbol with another. It is not recursive.

*) First apply `extra-keyboard-modifiers' mask to each keyboard
  character read.

*) Each character read from the keyboard may be translated according
  to `keyboard-translate-table'.

*) Characters that are self-inserting are translated according to
  `translation-table-for-input'. If a character is self-inserting then
  you are ready.

*) Translate meta characters according to `meta-prefix-char' to a two
  character sequence.

FIRST-MAP) Look in `special-event-map'.

*) If using `read-from-minibuffer' (directly or indirectly) then look
  in the keymap given as parameter then look in this. Otherwise look
  in `minibuffer-local-map'.

*) If using `read-no-blanks-input' to read from minibuffer then look
  in `minibuffer-local-ns-map' first and then `minibuffer-local-map'.

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

*) 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 `emulation-mode-map-alists'.

*) Look for minor mode keymaps in `minor-mode-overriding-map-alist'

*) Look for minor mode keymaps in `minor-mode-map-alist'.

*) Is there a `local-map' property of the text or overlay at point?

*) Is there a "local keymap" (those are for major modes)?

GLOBAL) Look in the "current global keymap". (This is returned by
  `current-global-map' and may be different from `global-map', see
  `use-global-map'.)

*) If it is an ASCII function key sequences then look in
  function-key-map. This map transforms to Emacs key sequences.

*) The possibly transformed sequence after applying `function-key-map'
  is now handled to `key-translation-map' which works the same way.

*) If any transformation was made by `function-key-map' or
  `key-translation-map' then take the new sequence and go back to
  FIRST-MAP.

Note: You may also find the function `current-active-maps' useful.





reply via email to

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