Variable: input-method-function
input-method-function is a variable defined in keyboard.c.
Value
list
Documentation
If non-nil, the function that implements the current input method.
It's called with one argument, which must be a single-byte
character that was just read. Any single-byte character is
acceptable, except the DEL character, codepoint 127 decimal, 177 octal.
Typically this function uses read-event to read additional events.
When it does so, it should first bind input-method-function to nil
so it will not be called recursively.
The function should return a list of zero or more events
to be used as input. If it wants to put back some events
to be reconsidered, separately, by the input method,
it can add them to the beginning of unread-command-events.
The input method function can find in input-method-previous-message
the previous echo area message.
The input method function should refer to the variables
input-method-use-echo-area and input-method-exit-on-first-char
for guidance on what to do.
Probably introduced at or before Emacs version 20.3.
Source Code
// Defined in /usr/src/emacs/src/keyboard.c
DEFVAR_LISP ("input-method-function", Vinput_method_function,
doc: /* If non-nil, the function that implements the current input method.
It's called with one argument, which must be a single-byte
character that was just read. Any single-byte character is
acceptable, except the DEL character, codepoint 127 decimal, 177 octal.
Typically this function uses `read-event' to read additional events.
When it does so, it should first bind `input-method-function' to nil
so it will not be called recursively.
The function should return a list of zero or more events
to be used as input. If it wants to put back some events
to be reconsidered, separately, by the input method,
it can add them to the beginning of `unread-command-events'.
The input method function can find in `input-method-previous-message'
the previous echo area message.
The input method function should refer to the variables
`input-method-use-echo-area' and `input-method-exit-on-first-char'
for guidance on what to do. */);