Subject: bug#50241: flyspell doesn't work with multiple dictionaries

From: Konstantin Kharlamov <[email-masked]>
Date: Sat, 28 Aug 2021 22:35:05 +0300

I found a wrokaround: executing the following code *twice* makes it work:

    (progn
      (require 'ispell)
      (setq ispell-program-name "hunspell")
      (ispell-hunspell-add-multi-dic "ru_RU,en_US")
      (setq ispell-local-dictionary
            '(("ru_RU,en_US" "[[:alpha:]]" "[^[:alpha:]]" "['0-9]" t ("-d"
    "ru_RU,en_US") nil utf-8)))
      (ispell-change-dictionary "ru_RU,en_US")
      (flyspell-mode 1)
      )

So, manually creating an entry in ispell-local-dictionary makes it work. However note I emphasized "twice" word — for some readon (I don't know why) even this workaround works if you execute this code twice. On the first evaluation it always generates an error. I tried changing the order of various expressions, but so far wasn't able to make it behave always same way (not sure it really matters though as it's just a a workaround).