東山n条より

京都在住情報系学生のメモ。

Mac において aspell を使って Emacs でスペルチェック

MacOSX 1.8.2 において、aspell を使って Emacs でスペルチェックを行えるようにします。

1.aspell を Macport でダウンロード・インストール

sudo port install aspell  
sudo port install aspell-dict-en  

port で aspell と辞書をインストールする。

2.英語のスペルチェック用に .aspell.conf を用意

echo "lang en_US" > ~/.aspell.conf

英語のスペルチェックに aspell を使用するために,.aspell.conf を用意する。

3..emacs に aspell の設定を行う

;; spel-checker                                                                                                                                  
(setq ispell-program-name "/opt/local/bin/aspell")
(eval-after-load "ispell"
  '(setq ispell-skip-region-alist (cons '("[^A-Za-z0-9 -]+")
                                        ispell-skip-region-alist)))

aspell が英語と日本語に混じった文章にも対応するように .emacs に設定を行う・
以上で設定は終了。

後は、スペルチェックを行いたい単語で

M-x $

もしくは、スペルチェックを行いたい範囲を選択して

M-x ispell-region

文章全体をスペルチェックを行いたい場合は

M-x ispell-buffer

でスペルチェックを行う事ができる。