diff options
| -rw-r--r-- | lispref/keymaps.texi | 38 |
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 | |||
| 569 | of them are @dfn{active}, meaning that they participate in the | 569 | of them are @dfn{active}, meaning that they participate in the |
| 570 | interpretation of user input. All the active keymaps are used | 570 | interpretation of user input. All the active keymaps are used |
| 571 | together to determine what command to execute when a key is entered. | 571 | together to determine what command to execute when a key is entered. |
| 572 | Emacs searches these keymaps one by one, in a standard order, until it | ||
| 573 | finds 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, |
| 576 | the keymaps of any enabled minor modes, the current buffer's local | 574 | the keymaps of any enabled minor modes, the current buffer's local |
| 577 | keymap, and the global keymap, in that order. Therefore, Emacs | 575 | keymap, and the global keymap, in that order. Emacs searches for each |
| 578 | searches for each input key sequence in all these keymaps. Here is a | 576 | input key sequence in all these keymaps. @xref{Searching Keymaps}, |
| 579 | pseudo-Lisp description of how this process works: | 577 | for 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 | ||
| 597 | Here, the pseudo-function @var{find-in} means to look up the key | ||
| 598 | sequence in a single map, and @var{find-in-any} means to search the | ||
| 599 | appropriate keymaps from an alist. (Searching a single keymap for a | ||
| 600 | binding 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 |
| 603 | regardless of the current buffer, such as @kbd{C-f}. The variable | 580 | regardless 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 |
| 691 | Emacs looks for them in the active keymaps. Here is a pseudo-Lisp | 668 | Keymaps}) Emacs looks for them in the active keymaps. Here is a |
| 692 | description of the order in which the active keymaps are searched: | 669 | pseudo-Lisp description of the order and conditions for searching |
| 670 | them: | ||
| 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 |
| 710 | The @var{find-in} and @var{find-in-any} are pseudo functions that | 688 | The @var{find-in} and @var{find-in-any} are pseudo functions that |
| 711 | search in one keymap and in an alist of keymaps, respectively. | 689 | search in one keymap and in an alist of keymaps, respectively. |
| 690 | (Searching a single keymap for a binding is called @dfn{key lookup}; | ||
| 691 | see @ref{Key Lookup}.) | ||
| 712 | 692 | ||
| 713 | @enumerate | 693 | @enumerate |
| 714 | @item | 694 | @item |