我无法构建 aspell,所以我正在尝试 hunspell。建立了hunspell。设置 .emacs 以便 emacs 可以(并且确实)找到可执行文件,如下所示:
;;; Spell checking using hunspell
(setq ispell-dictionary-alist
'((nil "[A-Za-z]" "[^A-Za-z]" "[']" t
("-d" "en_US" "-i" "utf-8") nil utf-8)
("american"
"[A-Za-z]" "[^A-Za-z]" "[']" nil
("-d" "en_US") nil utf-8)
("english"
"[A-Za-z]" "[^A-Za-z]" "[']" nil
("-d" "en_GB") nil utf-8)
("british"
"[A-Za-z]" "[^A-Za-z]" "[']" nil
("-d" "en_GB") nil utf-8)
("norsk"
"[A-Za-zÉÆØÅéæøå]" "[^A-Za-zÉÆØÅéæøå]" "[\"]" nil
("-d" "nb_NO") "~list" utf-8)))
(eval-after-load "ispell"
(progn
(setq ispell-dictionary "english"
ispell-extra-args '("-a" "-i" "utf-8")
ispell-silently-savep t)))
(setq ispell-dictionary "en_US")
(setq ispell-program-name "/usr/local/bin/hunspell")
这在我的 .bash_profile
export DICTIONARY=en_US
export DICPATH=/Users/myname/Applications/en_US
也试过
export DICTIONARY=en_US
export DICPATH=/Users/gpajer/Applications/
(有一个目录 ~/Applications/en_US 存放字典文件)
但是 ispell-buffer 返回类似
Can't open affix or dictionary flies for dictionary named "english".
@(#) International Ispell Version 3.2.06 (but really Hunspell 1.3.2)
@(#) International Ispell Version 3.2.06 (but really Hunspell 1.3.2)
hunspell 找不到字典吗?有什么特别的地方应该放字典吗?或者我如何告诉 emacs/hunspell 在哪里查找字典?