简体   繁体   中英

Flyspell not loading automatically with LaTeX file

Trying to use Flyspell with LaTeX files. Setup looks like this:

(require 'ispell)
(setq ispell-program-name "/usr/local/bin/hunspell") ;; From Homebrew, version 1.4.1
(add-to-list 'ispell-local-dictionary-alist '("de_DE_OLDSPELL" "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-d" "de_DE_OLDSPELL") nil iso-8859-1))
(setq ispell-dictionary "de_DE_OLDSPELL")
(add-hook 'text-mode-hook 'turn-on-flyspell)

Won't load automatically when opening a text (or LaTeX) file, but works fine when loaded manually. How to get Flyspell to load automatically? Probably a simple answer, but I've been going in circles for a while with this.

Apparently, this is a known problem in interactions between Hunspell and Emacs 24.4+. If Hunspell does not have a dictionary available that corresponds to the value of LANG in Emacs, the autoconfigure will fail. So, set DICTIONARY to the base file name of a dictionary that is available. Hunspell usually insists on an English dictionary, so (setenv DICTIONARY "en_US") or the like should do the trick. That particular bit of code worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM