[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

22.8 Searching the Active Keymaps

After translation of event subsequences (voir la section Keymaps for Translating Sequences of Events) Emacs looks for them in the active keymaps. Here is a pseudo-Lisp description of the order and conditions for searching them:

 
(or (if overriding-terminal-local-map
        (find-in overriding-terminal-local-map)
      (if overriding-local-map
          (find-in overriding-local-map)
        (or (find-in (get-char-property (point) 'keymap))
            (find-in-any emulation-mode-map-alists)
            (find-in-any minor-mode-overriding-map-alist)
            (find-in-any minor-mode-map-alist)
            (if (get-text-property (point) 'local-map)
                (find-in (get-char-property (point) 'local-map))
              (find-in (current-local-map))))))
    (find-in (current-global-map)))

The find-in and find-in-any are pseudo functions that search in one keymap and in an alist of keymaps, respectively. (Searching a single keymap for a binding is called key lookup; see Key Lookup.) If the key sequence starts with a mouse event, or a symbolic prefix event followed by a mouse event, that event's position is used instead of point and the current buffer. Mouse events on an embedded string use non-nil text properties from that string instead of the buffer.

  1. The function finally found may be remapped (voir la section Remapping Commands).
  2. Characters that are bound to self-insert-command are translated according to translation-table-for-input before insertion.
  3. current-active-maps returns a list of the currently active keymaps at point.
  4. When a match is found (voir la section Key Lookup), if the binding in the keymap is a function, the search is over. However if the keymap entry is a symbol with a value or a string, Emacs replaces the input key sequences with the variable's value or the string, and restarts the search of the active keymaps.

Ce document a été généré par Eric Reinbold le 13 Octobre 2007 en utilisant texi2html 1.78.