2

I used flyspell-mode with aspell backend before, but now I want to make the transition to the hunspell so that I could use multiple dictionaries.

To do so, I added the following lines to the init.el:

(setq ispell-program-name "hunspell")
(setq ispell-local-dictionary "en_US")
(setq ispell-local-dictionary-alist '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US") nil utf-8)))

But when I enable flyspell-mode for the first time in sesstion, it throws error:

Error enabling Flyspell mode:
(stringp nil)

When I enabling it again, it works just fine.

If I comment out all but the first line, flyspell fails every time.

How can I fix this?

GNU Emacs 26.1; Debian buster; flyspell 20181205;

2

After some debugging I found that ispell-minor-mode needed ispell-hunspell-dictionary-alist variable set. This code works:

(setq ispell-program-name "hunspell")
(setq ispell-local-dictionary "en_US,ru_RU")
(setq ispell-hunspell-dictionary-alist '(("en_US,ru_RU" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US,ru_RU") nil utf-8)))
  • Great!! That worked; I was searching for quite a while for that solution... Thanks – phynfo May 31 at 5:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.