@kyanny's blog

My thoughts, my life. Views/opinions are my own.

Cocoa Emacs のディレクトリ以下に Mew をインストール

Mew が cannot load file とかのエラーで起動できなくなった。 load-path をチェックしてみるも、ちゃんと /usr/local/share/emacs/site-lisp/mew とかは含まれている。 /Applicatoins/Emacs.app/Resources/site-lisp 以下とかにないとまずいのかな、と思って、 /usr/local/share/emacs/site-lisp/mew 以下は全部消して、コンパイルからやり直してみる。

configure オプションは以下のようにした。 Emacs.app は、 cvs co してきた emacs を --with-ns でコンパイルしてできた Emacs.app をふつうに Finder で「アプリケーション」フォルダへコピーしただけ。 Finder からはプログラムアイコン一つにみえるけど shell からみるとディレクトリになっている。

  $ ./configure --prefix=/Applications/Emacs.app/Contents/MacOS \
      --with-emacs=/Applications/Emacs.app/Contents/MacOS/Emacs \
      --with-elispdir=/Applications/Emacs.app/Contents/Resources/site-lisp \
      --with-etcdir=/Applications/Emacs.app/Contents/Resources/etc \
      --localstatedir=/Applications/Emacs.app/Contents/Resources/var \
      --infodir=/Applications/Emacs.app/Contents/Resources/info \
      --mandir=/Applications/Emacs.app/Contents/Resources/man
    • with-elispdir と --with-infodir あたりが重要そうな気がする。 --prefix をつけないと smew コマンドとかは /usr/local/bin へ行ってしまうのでそっちも気をつける。

この手のログはメモをとるのを忘れても config.log ファイルに書いてあるので安心。ちょっと新しい configure スクリプトだと、 config.status のなんとかいうオプションで configure 行を取り出すこともできる。

Mew は configure が終わったあとに、どのファイルがどこのディレクトリにインストールされるかをメッセージで教えてくれる。親切だ。意図したところへインストールされるか確認してから make できるのは安心だ。

***************************
 Mew configuration results
***************************

-n use emacs             : 
/Applications/Emacs.app/Contents/MacOS/Emacs
-n elisp files should go : 
/Applications/Emacs.app/Contents/Resources/site-lisp
-n etc files should go   : 
/Applications/Emacs.app/Contents/Resources/etc
-n exec files should go  : 
/Applications/Emacs.app/Contents/MacOS/bin
-n info files should go  : 
/Applications/Emacs.app/Contents/Resources/info
-n man files should go   : 
/Applications/Emacs.app/Contents/Resources/man/man1

Then type 'make', 'make info' and 'make install'.
For Japanese environment, also 'make jinfo' and 'make install-jinfo'.

無事に Mew が使えるようになった。