Emacs Mac Portに日本語入力関連の機能が追加

Warning: simplexml_load_string(): Entity: line 1: parser error : Space required after the Public Identifier in /var/www/wordpress/wp-content/plugins/wp-hamazon/app/Hametuha/WpHamazon/Constants/AmazonConstants.php on line 168 Warning: simplexml_load_string(): in /var/www/wordpress/wp-content/plugins/wp-hamazon/app/Hametuha/WpHamazon/Constants/AmazonConstants.php on line 168 Warning: simplexml_load_string(): ^ in /var/www/wordpress/wp-content/plugins/wp-hamazon/app/Hametuha/WpHamazon/Constants/AmazonConstants.php on line 168 Warning: simplexml_load_string(): Entity: line 1: parser error : SystemLiteral " or ' expected in /var/www/wordpress/wp-content/plugins/wp-hamazon/app/Hametuha/WpHamazon/Constants/AmazonConstants.php on line 168 Warning: simplexml_load_string(): in /var/www/wordpress/wp-content/plugins/wp-hamazon/app/Hametuha/WpHamazon/Constants/AmazonConstants.php on line 168 Warning: simplexml_load_string(): ^ in /var/www/wordpress/wp-content/plugins/wp-hamazon/app/Hametuha/WpHamazon/Constants/AmazonConstants.php on line 168 Warning: simplexml_load_string(): Entity: line 1: parser error : SYSTEM or PUBLIC, the URI is missing in /var/www/wordpress/wp-content/plugins/wp-hamazon/app/Hametuha/WpHamazon/Constants/AmazonConstants.php on line 168 Warning: simplexml_load_string(): in /var/www/wordpress/wp-content/plugins/wp-hamazon/app/Hametuha/WpHamazon/Constants/AmazonConstants.php on line 168 Warning: simplexml_load_string(): ^ in /var/www/wordpress/wp-content/plugins/wp-hamazon/app/Hametuha/WpHamazon/Constants/AmazonConstants.php on line 168
Pocket
LINEで送る
はてなブックマーク - Emacs Mac Portに日本語入力関連の機能が追加

以前の記事でインラインパッチがないのでEmacs Mac Portを諦めてHomebrew+インラインパッチのEmacsを使っているという記事を書きました。

昨日Emacs Mac Portの更新内容を眺めていたら、日本語入力関連の機能が幾つか追加されているのを発見。

もしかしたらと思い、調べてみたらかなりいい感じに使えそうな追加機能でした。

広告

Emacs Mac Port 5.2の日本語関連追加機能

NEWS-macには次のように書かれています。

*** New functions and hooks for interaction with the Text Input Source
Services on Mac OS X 10.5 and later: mac-input-source',mac-input-source-list’, mac-select-input-source',mac-deselect-input-source’,
mac-selected-keyboard-input-source-change-hook', and mac-enabled-keyboard-input-sources-change-hook’.
*** New global minor mode `mac-auto-ascii-mode’ for Mac OS X 10.5 and
later. If enabled, it automatically selects the most-recently-used
ASCII-capable keyboard input source on some occasions: after prefix
key (bound in the global keymap) press such as C-x and M-g, and at the
start of minibuffer input.
Note: Strictly speaking, its implementation has a timing issue: the
Lisp event queue may already have some input events that have been
processed by some previous keyboard input source but yet to be
processed by the Lisp interpreter.

上の方は入力モードの種類リストと入力モード変更時のフックと思われます。

下のはmac-auto-ascii-modeというのが追加されて、ミニバッファに入るようなプレフィクスを入力したら自動的にアスキー入力モードにしてくれる、と書いてるような気がします。
もしかしたらインラインパッチなしのEmacsのネックである、日本語モードがオンのままだったので挙動が把握できず混乱する、というのが防げるかも。

日本語入力モードでコマンドを呼び出してみる

というわけでさっそく試してみました。

日本語入力モードのまま’C-x 3’した時の動作の違いとして例を挙げます。

  • 素のEmacs
    • C-xでミニバッファが開いたあと未確定の’3’が表示される
    • 未確定の文字があるので入力モードを英字入力モードに戻すのもややこしい
  • IMEインラインパッチをあてたEmacs
    • ‘C-x 3’で何事も無くバッファが分割される
    • バッファが分割された後の入力モードは日本語入力モード
  • Emacs Mac Port(mac-auto-ascii-mode)
    • C-x 3’で何事も無くバッファが分割される
    • バッファが分割された後の入力モードはアスキー入力モード

日本語入力モードでも普通にコマンドが実行できました! やった!

コマンド実行後の入力モードに差がありますが、慣れれば問題ない気がします。入力モードフックが追加されたのでカーソルに入力モードの違い情報を入れておくことも出来るでしょうし。

Emacs自体の動作自体はEmacs Mac Port版がとてもよかったので、とりあえずこちらを使っていこうと思います。

あ、あとinit-loaderがいつのまにかEmacs Mac Port版でもcocoa-*.elを読んでくれるようになっていました(以前はwindow-systemがnsでないMac Port版は判定されなかった)。この変更もありがたい・・・。

“Emacs Mac Portに日本語入力関連の機能が追加” への1件の返信

  1. ピンバック: Macで本家EmacsとHomebrew IMEパッチ版とEmacs Mac PortとAquamacsを比べてみる。 | たったのセブンクレジット

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

*