我想在 GNU Emacs 24.5.1(在 Mac OS X 11.10 上)中激活拼写检查。我做了以下事情:
1) brew install hunspell
2) cd ~/Library/Spelling
wget http://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.aff
wget http://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.dic
(hunspell -D
从终端正确运行)。在~/.bash_profile
我设置export DICTIONARY=en_US
和我的~/.emacs
节目中:
;; Activate Hunspell
(when (executable-find "hunspell")
(setq-default ispell-program-name "/usr/local/bin/hunspell")
(setq ispell-really-hunspell t))
;; Activate flyspell
(add-hook 'text-mode-hook 'flyspell-mode)
(add-hook 'message-mode-hook 'flyspell-mode)
(setq flyspell-issue-message-flag nil)
(mapcar (lambda (mode-hook) (add-hook mode-hook 'flyspell-prog-mode))
'(c-mode-common-hook R-mode-hook emacs-lisp-mode-hook))
但是,当我打开任何.txt
文件时,我看不到带下划线的拼写检查错误或任何内容......并且M-x ispell
显示ispell-parse-hunspell-affix-file: ispell-phaf: No matching entry for nil.
. 我怎样才能让它工作?