Reply to comment

Configuring Japanese input in Emacs using Anthy

When writing Japanese under Ubuntu, I use Anthy (one of popular Japanese input systems) with IBus (Intelligent Input Bus for Linux / Unix OS) input method for all X applications but Emacs. Interestingly, there seems to be no IBus interfaces available to Emacs at this moment. For Emacs, I use Anthy through anthy.el interface, which seems to be the most common option when writing Japanese under Emacs. In this post, I summarize how to configure Japanese input with Anthy under Emacs.

Japanese input by Anthy

Method

First, install Anthy and its interface for Emacs:

$ sudo apt-get install anthy anthy-el

Then, edit .emacs.el (the default configuration file of Emacs) to add the following block (bold lines are comments):

; Set load path for anthy.el
(push "/usr/share/emacs/site-lisp/anthy/" load-path)

; Load anthy.el
(load-library "leim-list")
(load-library "anthy")

;; Workarounds and customizations

; Fix slow input response in emacs23
(if (>= emacs-major-version 23)
(setq anthy-accept-timeout 1))

; Set japanese-anthy as the default input-method
(setq default-input-method "japanese-anthy")

; Shift-space to toggle anthy-mode (default is Ctrl-\)
(global-set-key (kbd "S-SPC") 'anthy-mode)

; Map wide-space to hankaku-space
(setq anthy-wide-space " ")

Finally, re-start Emacs and you can invoke anthy-mode by Shift-space. Enjoy writing Japanese!

Reply

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.