N900上のemacsで日本語入力

Screenshot-20091219-001642

Nokia N900は今のところ日本語入力を行うことはできません(表示だけはデフォルトで可能)。このため、日本のN900ユーザの多くはsumibiというWEBサービスで日本語入力(変換)して、それをコピーペーストするという方法を使っています。しかし、この方法だとオフライン状態では日本語の入力ができません。なので、なんとかならないかなぁっと調べていたのですが、N900でemacsを動かし、emacs標準のkkcを使い日本語入力を実現するという方法がありました(Full Chinese Japanese Korean (CJK) input on Nokia N900)。

emacsの導入については、ほぼ上記のサイトどおりでいけましたが、若干手順が違ったので、備忘録代わりに書いておきます。

まず、emacsの導入手順は、GNU Emacs for Nokia N900のBASIC手順に従いました。

step.2のrootshは、ここからインストールできます。

step.5でemacsをインストールしますが、ほぼ確実に「 libungif4g libxpm4 librsvg2-2」の3つがないというエラーがでると思います。上記サイトの手順では、step.6を実行しろということになっていますが、step.6を実行しても、librsvg2-2だけはインストールができません(少なくとも私はできませんでした)。なので、これだけは、別途、ここからインストールします(step.6を実行後、再度step.5を実行(emacsの再インストール)を実行した方がいいかも)。

step.7、step.8は不要です。

この段階で、X-terminalから、
~ $ emacs.sh
で、emacsが起動できるようになっているはずです(もしくはアプリケーションショートカットから起動)。もし起動できなかったり、ショートカットがなかったりする場合は、うまくインストールできていないということになります(おそらくstep.5、step.6の部分)。

emacsが起動できれば、あとは
C-x RET C- Japanese RET
で日本語入力モードになります。
このコマンドを入力するのも面倒ですが、.emacsというファイルに設定を書いておくと、コマンドを省略したり、挙動を変更することが可能です。

参考に(なるかどうかわかりませんが)、現在の私の.emacsは下記。

(add-to-list ‘load-path “~/elisp/maxframe”)
(require ‘maxframe)

(setq mf-max-height 430)
(add-hook ‘window-setup-hook ‘maximize-frame t)
(maximize-frame)

(set-clipboard-coding-system ‘utf-8)
(setq x-select-enable-clipboard t)

(set-language-environment “japanese”)
(if (and (require ‘quail) (require ‘kkc))
(progn
(setq quail-japanese-use-double-n t)))

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won’t work right.
‘(cua-mode t nil (cua-base))
‘(default-input-method “japanese”)
‘(initial-buffer-choice t)
‘(tool-bar-mode nil))

(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won’t work right.
‘(default ((t (:inherit nil :stipple nil :background “white” :foreground “black” :inverse-video nil :box nil :strike-through nil : overline nil :underline nil :slant normal :weight light :height 203 :width normal :foundry “monotype” :family “MHeiGB18030C-Medium”)))))

タイトルとURLをコピーしました