2011年12月23日金曜日

emacsclient with Emacs 23

Mac で Emacs の org-mode を使いたかったので、 org-mode が標準で備わっている Emacs 23 を インストールして使い始めた。(Mac に元々入っているのはEmacs 22。) すると、下記のようなエラーが出てemacsclient がうまく起動しなくなった。
emacsclient: can't find socket; have you started the server?     
To start the server in Emacs, type "M-x server-start".     
emacsclient: No socket or alternate editor.  Please use:

     --socket-name
     --server-file      (or environment variable EMACS_SERVER_FILE)  
     --alternate-editor (or environment variable ALTERNATE_EDITOR)

原因は emaceclient のバージョンが 22 になっていたため。 emacsclient と Emacs はバージョンを合わせる必要がある。
   
$ locate emacsclient
/opt/local/bin/emacsclient                     # <- コレか
/opt/local/share/man/man1/emacsclient.1.gz
/usr/bin/emacsclient                           # <- コレのどちらか
/usr/share/emacs/22.1/etc/emacsclient.1
/usr/share/man/man1/emacsclient.1.gz

$ /usr/bin/emacsclient --version
emacsclient 22.1

$ /opt/local/bin/emacsclient --version
emacsclient 23.3

$ which emacsclient
/usr/bin/emacsclient     # ver. 22.1 の方が呼ばれていた

emacsclient 23.3 の方のパスから呼び出すようにしてOK.

参考: http://www.emacswiki.org/emacs/EmacsClient#toc41
参考: Emacsテクニックバイブル ~作業効率をカイゼンする200の技~





0 件のコメント:

コメントを投稿