Function: set-input-method
set-input-method is an interactive and byte-compiled function defined
in mule-cmds.el.gz.
Signature
(set-input-method INPUT-METHOD &optional INTERACTIVE)
Documentation
Select and activate input method INPUT-METHOD for the current buffer.
This also sets the default input method to the one you specify.
If INPUT-METHOD is nil, this function turns off the input method, and
also causes you to be prompted for a name of an input method the next
time you invoke C-\ (toggle-input-method).
When called interactively, the optional arg INTERACTIVE is non-nil,
which marks the variable default-input-method as set for Custom buffers.
To deactivate the input method interactively, use C-\ (toggle-input-method).
To deactivate it programmatically, use deactivate-input-method.
Probably introduced at or before Emacs version 20.3.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/international/mule-cmds.el.gz
(defun set-input-method (input-method &optional interactive)
"Select and activate input method INPUT-METHOD for the current buffer.
This also sets the default input method to the one you specify.
If INPUT-METHOD is nil, this function turns off the input method, and
also causes you to be prompted for a name of an input method the next
time you invoke \\[toggle-input-method].
When called interactively, the optional arg INTERACTIVE is non-nil,
which marks the variable `default-input-method' as set for Custom buffers.
To deactivate the input method interactively, use \\[toggle-input-method].
To deactivate it programmatically, use `deactivate-input-method'."
(interactive
(let* ((default (or (car input-method-history) default-input-method)))
(list (read-input-method-name
(format-prompt "Select input method" default)
default t)
t)))
(activate-input-method input-method)
(setq default-input-method input-method)
(when interactive
(customize-mark-as-set 'default-input-method))
default-input-method)