@item C-x @key{RET} C-\ @var{method} @key{RET}
Select a new input method for the current buffer (@code{set-input-method}).
+@item C-x \ @var{method} @key{RET}
+Temporarily enable the selected transient input method, and
+automatically disable it after inserting a single character
+(@code{transient-input-method}).
+
@item C-h I @var{method} @key{RET}
@itemx C-h C-\ @var{method} @key{RET}
@findex describe-input-method
input methods. The list gives information about each input method,
including the string that stands for it in the mode line.
+@findex transient-input-method
+@kindex C-x \
+ To insert only a single character using a transient input method you
+can first select a transient input method by typing @kbd{C-u C-x \}.
+Then typing @kbd{C-x \} (@code{transient-input-method}) will
+temporarily enable the selected transient input method, and disable it
+automatically after using the activated input method to insert
+a single character. This is useful to insert a character from input
+methods with rare Unicode characters.
+
@node Coding Systems
@section Coding Systems
@cindex coding systems
characters. In particular, this significantly improves word-wrapping
for CJK text mixed with Latin text.
----
-** New input method 'compose' based on X Multi_key sequences.
-
----
-** Improved language transliteration in Malayalam input methods.
-Added a new Mozhi scheme. The inapplicable ITRANS scheme is now
-deprecated. Errors in the Inscript method were corrected.
-
---
** Rudimentary support for the 'st' terminal emulator.
Emacs now supports 256 color display on the 'st' terminal emulator.
The menu bar "Help" menu now has a "Show Recent Inputs" item under the
"Describe" sub-menu.
+** Input methods
+
++++
+*** 'C-x \' temporarily enables a transient input method.
+'C-u C-x \' can be used to select a transient input method, e.g.
+'C-u C-x \ compose RET' selects the 'compose' input method. Then typing
+'C-x \ 1 2' will insert the character '½', and disable the input method
+afterwards.
+
+---
+*** New input method 'compose' based on X Multi_key sequences.
+
+---
+*** Improved language transliteration in Malayalam input methods.
+Added a new Mozhi scheme. The inapplicable ITRANS scheme is now
+deprecated. Errors in the Inscript method were corrected.
+
** Ispell
+++
;; Keep "C-x C-m ..." for mule specific commands.
(define-key ctl-x-map "\C-m" mule-keymap)
+(define-key ctl-x-map "\\" 'transient-input-method)
(defvar describe-language-environment-map
(let ((map (make-sparse-keymap "Describe Language Environment")))
mule-input-method-string)
:set-after '(current-language-environment))
+(defcustom transient-input-method nil
+ "Default transient input method.
+This is the input method activated automatically by the command
+`transient-input-method' (\\[transient-input-method])."
+ :link '(custom-manual "(emacs)Input Methods")
+ :group 'mule
+ :type '(choice (const nil)
+ mule-input-method-string)
+ :set-after '(current-language-environment))
+
(put 'input-method-function 'permanent-local t)
(defvar input-method-history nil
(defvar toggle-input-method-active nil
"Non-nil inside `toggle-input-method'.")
+(defun transient-input-method (&optional arg interactive)
+ "Enable transient input method for the current buffer."
+ (interactive "P\np")
+ (when (or arg (not transient-input-method))
+ (let* ((default (or (car input-method-history) default-input-method))
+ (input-method
+ (read-input-method-name
+ (if default "Transient input method (default %s): " "Transient input method: ")
+ default t)))
+ (setq transient-input-method input-method)
+ (when interactive
+ (customize-mark-as-set 'transient-input-method))))
+ (let* ((previous-input-method current-input-method)
+ (history input-method-history)
+ (clearfun (make-symbol "clear-transient-input-method"))
+ (exitfun
+ (lambda ()
+ (deactivate-input-method)
+ (when previous-input-method
+ (activate-input-method previous-input-method))
+ (setq input-method-history history)
+ (remove-hook 'input-method-after-insert-chunk-hook clearfun))))
+ (fset clearfun (lambda () (funcall exitfun)))
+ (add-hook 'input-method-after-insert-chunk-hook clearfun)
+ (when previous-input-method
+ (deactivate-input-method))
+ (activate-input-method transient-input-method)
+ exitfun))
+
(defun toggle-input-method (&optional arg interactive)
"Enable or disable multilingual text input method for the current buffer.
Only one input method can be enabled at any time in a given buffer.