aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lispref/keymaps.texi38
1 files changed, 9 insertions, 29 deletions
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi
index c626b46e544..2e38514c00d 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -569,35 +569,12 @@ string for the keymap. The prompt string should be given for menu keymaps
569of them are @dfn{active}, meaning that they participate in the 569of them are @dfn{active}, meaning that they participate in the
570interpretation of user input. All the active keymaps are used 570interpretation of user input. All the active keymaps are used
571together to determine what command to execute when a key is entered. 571together to determine what command to execute when a key is entered.
572Emacs searches these keymaps one by one, in a standard order, until it
573finds a binding in one of the keymaps.
574 572
575 Normally the active keymaps are the @code{keymap} property keymap, 573 Normally the active keymaps are the @code{keymap} property keymap,
576the keymaps of any enabled minor modes, the current buffer's local 574the keymaps of any enabled minor modes, the current buffer's local
577keymap, and the global keymap, in that order. Therefore, Emacs 575keymap, and the global keymap, in that order. Emacs searches for each
578searches for each input key sequence in all these keymaps. Here is a 576input key sequence in all these keymaps. @xref{Searching Keymaps},
579pseudo-Lisp description of how this process works: 577for more details of this procedure.
580
581@lisp
582(or (if overriding-terminal-local-map
583 (@var{find-in} overriding-terminal-local-map)
584 (if overriding-local-map
585 (@var{find-in} overriding-local-map)
586 (or (@var{find-in} (get-text-property (point) 'keymap))
587 (@var{find-in-any} emulation-mode-map-alists)
588 (@var{find-in-any} minor-mode-overriding-map-alist)
589 (@var{find-in-any} minor-mode-map-alist)
590 (if (get-text-property (point) 'local-map)
591 (@var{find-in} (get-text-property (point) 'local-map))
592 (@var{find-in} (current-local-map))))))
593 (@var{find-in} (current-global-map)))
594@end lisp
595
596@noindent
597Here, the pseudo-function @var{find-in} means to look up the key
598sequence in a single map, and @var{find-in-any} means to search the
599appropriate keymaps from an alist. (Searching a single keymap for a
600binding is called @dfn{key lookup}; see @ref{Key Lookup}.)
601 578
602 The @dfn{global keymap} holds the bindings of keys that are defined 579 The @dfn{global keymap} holds the bindings of keys that are defined
603regardless of the current buffer, such as @kbd{C-f}. The variable 580regardless of the current buffer, such as @kbd{C-f}. The variable
@@ -687,9 +664,10 @@ An error is signaled if @var{key} is not a string or a vector.
687@node Searching Keymaps 664@node Searching Keymaps
688@section Searching the Active Keymaps 665@section Searching the Active Keymaps
689 666
690 After translation of event subsequences (@pxref{Translation Keymaps}) 667 After translation of event subsequences (@pxref{Translation
691Emacs looks for them in the active keymaps. Here is a pseudo-Lisp 668Keymaps}) Emacs looks for them in the active keymaps. Here is a
692description of the order in which the active keymaps are searched: 669pseudo-Lisp description of the order and conditions for searching
670them:
693 671
694@lisp 672@lisp
695(or (if overriding-terminal-local-map 673(or (if overriding-terminal-local-map
@@ -709,6 +687,8 @@ description of the order in which the active keymaps are searched:
709@noindent 687@noindent
710The @var{find-in} and @var{find-in-any} are pseudo functions that 688The @var{find-in} and @var{find-in-any} are pseudo functions that
711search in one keymap and in an alist of keymaps, respectively. 689search in one keymap and in an alist of keymaps, respectively.
690(Searching a single keymap for a binding is called @dfn{key lookup};
691see @ref{Key Lookup}.)
712 692
713@enumerate 693@enumerate
714@item 694@item