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/invoking-the-input-method.html | |
new repository
Diffstat (limited to 'devdocs/elisp/invoking-the-input-method.html')
| -rw-r--r-- | devdocs/elisp/invoking-the-input-method.html | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/devdocs/elisp/invoking-the-input-method.html b/devdocs/elisp/invoking-the-input-method.html new file mode 100644 index 00000000..df9c736d --- /dev/null +++ b/devdocs/elisp/invoking-the-input-method.html @@ -0,0 +1,10 @@ + <h4 class="subsection">Invoking the Input Method</h4> <p>The event-reading functions invoke the current input method, if any (see <a href="input-methods">Input Methods</a>). If the value of <code>input-method-function</code> is non-<code>nil</code>, it should be a function; when <code>read-event</code> reads a printing character (including <tt class="key">SPC</tt>) with no modifier bits, it calls that function, passing the character as an argument. </p> <dl> <dt id="input-method-function">Variable: <strong>input-method-function</strong> +</dt> <dd> +<p>If this is non-<code>nil</code>, its value specifies the current input method function. </p> <p><strong>Warning:</strong> don’t bind this variable with <code>let</code>. It is often buffer-local, and if you bind it around reading input (which is exactly when you <em>would</em> bind it), switching buffers asynchronously while Emacs is waiting will cause the value to be restored in the wrong buffer. </p> +</dd> +</dl> <p>The input method function should return a list of events which should be used as input. (If the list is <code>nil</code>, that means there is no input, so <code>read-event</code> waits for another event.) These events are processed before the events in <code>unread-command-events</code> (see <a href="event-input-misc">Event Input Misc</a>). Events returned by the input method function are not passed to the input method function again, even if they are printing characters with no modifier bits. </p> <p>If the input method function calls <code>read-event</code> or <code>read-key-sequence</code>, it should bind <code>input-method-function</code> to <code>nil</code> first, to prevent recursion. </p> <p>The input method function is not called when reading the second and subsequent events of a key sequence. Thus, these characters are not subject to input method processing. The input method function should test the values of <code>overriding-local-map</code> and <code>overriding-terminal-local-map</code>; if either of these variables is non-<code>nil</code>, the input method should put its argument into a list and return that list with no further processing. </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/Invoking-the-Input-Method.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Invoking-the-Input-Method.html</a> + </p> +</div> |
