Input methods

From WikEmacs
Revision as of 05:39, 1 April 2012 by (Talk)

Jump to: navigation, search

Input Methods allow you to enter characters that are not supported by your keyboard.

  • 'C-x C-m C-\' or `M-x set-input-method' or switch to a new input method.
  • 'C-h C-\' or `C-h I' to describe the current input method.
  • 'C-\' to toggle the input method on and off

Possibly the most convenient casual method for inputting unicode characters is the TeXInputMethod, which permits you to enter Unicode characters by typing a \ prefixed sequence reminiscent of TeX. For example, the greek character λ may be entered by typing \lambda.

You can use `latin-1-prefix' to input accented characters. So that you can type `" u' to achieve `ü', for example. You can also [C-x 8] to input accented characters.

Another way is to use QuotedInsert with `C-q'.

To activate the input method for a specific mode put the following line in your config file:

  (add-hook 'text-mode-hook 'toggle-input-method)

The input method is then automaticaly activated for files which open in text mode.

To activate the input method on a per-buffer basis. First put the following lines in the .emacs:

 (set input-activate nil)
 (add-hook 'find-file-hook
           (lambda ()(if (eq input-activate t) (toggle-input-method))))

Then put the following line at the beginning of a file:

 -*- input-activate: t -*-

The input method will be activated for this file as soon as it is loaded.

These are some additional input methods that do not come with Emacs:

  • Georgian (a bit different than the one that comes with Emacs): Lisp:georgian.el
  • Armenian: Lisp:armenian.el
  • Neo-Akkadian Cuneiform: Lisp:akkadian.el
  • Glagolitic: Lisp:glagolitic.el
  • Coptic: Lisp:coptic.el

It's convenient for people who speak in korean or japanese or etc... to use only the internal emacs input method (mule) without scim, nabi, Microsoft IME, etc...

See Also: ChangingCursorDynamically to automatically change the TextCursor color when you are using an input method. This makes it easy to tell if an input method is in use.