diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/searching-keymaps.html | |
new repository
Diffstat (limited to 'devdocs/elisp/searching-keymaps.html')
| -rw-r--r-- | devdocs/elisp/searching-keymaps.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/devdocs/elisp/searching-keymaps.html b/devdocs/elisp/searching-keymaps.html new file mode 100644 index 00000000..ef8a2b69 --- /dev/null +++ b/devdocs/elisp/searching-keymaps.html @@ -0,0 +1,19 @@ + <h3 class="section">Searching the Active Keymaps</h3> <p>Here is a pseudo-Lisp summary of how Emacs searches the active keymaps: </p> <div class="lisp"> <pre class="lisp">(or (if overriding-terminal-local-map + (<var>find-in</var> overriding-terminal-local-map)) + (if overriding-local-map + (<var>find-in</var> overriding-local-map) + (or (<var>find-in</var> (get-char-property (point) 'keymap)) + (<var>find-in-any</var> emulation-mode-map-alists) + (<var>find-in-any</var> minor-mode-overriding-map-alist) + (<var>find-in-any</var> minor-mode-map-alist) + (if (get-text-property (point) 'local-map) + (<var>find-in</var> (get-char-property (point) 'local-map)) + (<var>find-in</var> (current-local-map))))) + (<var>find-in</var> (current-global-map))) +</pre> +</div> <p>Here, <var>find-in</var> and <var>find-in-any</var> are pseudo functions that search in one keymap and in an alist of keymaps, respectively. Note that the <code>set-transient-map</code> function works by setting <code>overriding-terminal-local-map</code> (see <a href="controlling-active-maps">Controlling Active Maps</a>). </p> <p>In the above pseudo-code, if a key sequence starts with a mouse event (see <a href="mouse-events">Mouse Events</a>), that event’s position is used instead of point, and the event’s buffer is used instead of the current buffer. In particular, this affects how the <code>keymap</code> and <code>local-map</code> properties are looked up. If a mouse event occurs on a string embedded with a <code>display</code>, <code>before-string</code>, or <code>after-string</code> property (see <a href="special-properties">Special Properties</a>), and the string has a non-<code>nil</code> <code>keymap</code> or <code>local-map</code> property, that overrides the corresponding property in the underlying buffer text (i.e., the property specified by the underlying text is ignored). </p> <p>When a key binding is found in one of the active keymaps, and that binding is a command, the search is over—the command is executed. However, if the binding 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. See <a href="key-lookup">Key Lookup</a>. </p> <p>The command which is finally found might also be remapped. See <a href="remapping-commands">Remapping Commands</a>. </p><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Searching-Keymaps.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Searching-Keymaps.html</a> + </p> +</div> |
