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;

Sergey
  • 249
  • 1
  • 8

1 Answers1

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)))
Sergey
  • 249
  • 1
  • 8