2010年4月21日水曜日

Emacs でスペルチェックしたいので

Emacs で ispell を使いたくなったのですが、OpenSolaris のリポジトリには無いので、久しぶりに自分で構築することにしました。

GNU Emacs FAQ を見ると、ispell は International Ispell から持ってくるのが良さそうです。現行のバージョンということで、ispell-3.3.02.tar.gz をダウンロード。

wget -P ~/PATH/TO/WAREHOUSE http://www.lasr.cs.ucla.edu/geoff/tars/ispell-3.3.02.tar.gz

README ファイルを見ると、local.h.solarislocal.h にコピーして、必要があれば編集しろとのこと。 多少の試行錯誤の結果、次のように変更。 TERMLIB は変更しないと "-lncurses" が使用されて、コンパイルに失敗します。 ファイルの置き場所は基本的に好みの問題ですが、セクション番号はシステムの流儀にあわせます。

--- local.h.solaris 水  4月 27 07:40:08 2005
+++ local.h 水  4月 21 11:16:08 2010
@@ -67,6 +67,8 @@
 #define USG  /* Define on System V or if term.c won't compile */
 #define HAS_RENAME
 
+#define TERMLIB "-lcurses"
+
 /*
  * Important directory paths.  If you change MAN45DIR from man5 to
  * something else, you probably also want to set MAN45SECT and
@@ -73,11 +75,11 @@
  * MAN45EXT (but not if you keep the man pages in section 5 and just
  * store them in a different place).
  */
-#define BINDIR "/usr/local/bin"
-#define LIBDIR "/usr/local/lib"
-#define MAN1DIR "/usr/local/man/man1"
-#define MAN45DIR "/usr/local/man/man4"
-#define MAN45EXT ".4"
+#define BINDIR "/opt/free/bin"
+#define LIBDIR "/opt/free/share/ispell"
+#define MAN1DIR "/opt/free/share/man/man1"
+#define MAN45DIR "/opt/free/share/man/man5"
+#define MAN45EXT ".5"
 
 /*
  * Place any locally-required #include statements here

そして構築してインストール。 ディレクトリの自動作成がうまくいっていないようなので、自分で作成。 そして単に make install とすると不要なファイルまでインストールされるので、 必要なファイルだけということで partial-install を指定。

$ make
$ mkdir /opt/free/share/ispell
$ make partial-install

これで、無事に ispell が Emacs から使用できるようになりました。

0 件のコメント:

コメントを投稿