Subject: bug#25830: 25.2; ispell doesn't parse hunspell dictionaries properly

From: Martin Kletzander <[email-masked]>
Date: Tue, 21 Feb 2017 21:24:54 +0100

On Tue, Feb 21, 2017 at 07:23:08PM +0200, Eli Zaretskii wrote:
>> Date: Tue, 21 Feb 2017 10:18:57 +0100
>> From: Martin Kletzander <[email-masked]>
>>
>> I have hunspell installed in the system with two default dictionaries.
>
>Please tell more details about the meaning of this.  Do you mean you
>wanted to start Hunspell with 2 dictionaries so that it could
>spell-check text that mixes 2 different languages?  Or did you mean
>something else?  IOW, the "with two default dictionaries" part
>confuses me.
>

Sorry, Idon't know spellcheckers that much.  Ilooked at hunspell's man
page, learned a bit, so I'll try to explain it better this time.

I have multiple dictionaries installed.  Hunspell finds all of them, but
selects *two* of them.  According to the man page, that is done
according to LC_ALL, LC_MESSAGES, and LANG environment variables.
Becuase hunspell selects more of them (which is something I want it to
do), it lists both of them as "LOADED DICTIONARY", ispell parses those
(actually just lines ending with ".aff") and if it finds more than one,
it errors out.

>> I was trying to setup ispell so that it works properly and I couldn't.
>> So I started looking at the sources for ispell and I found one part that
>> can't work.  It may be intentional, but the real problem is that I can't
>> use spellchecker at all.  When `emacs -Q` is ran, it is enough to do M-$
>> with *no additinal settings*.  The error message (and following messages
>> for consecutive M-$) are visible below in 'Recent messages'.
>>
>> I could only trace the problem to the ispell.el where the error is
>> printed.  The reason for that is probably the fact that `hunspell -D`
>> has this output on my system:
>
>I don't immediately see anything wrong here.  Does spell-checking work
>if you set it up to use just one default dictionary, as usual?
>

That's another problem.  Since the initialization itself fails, it
errors out before it checks any set variables.  So no matter what I set
up, it ends up with the same behaviour.  If I remove the second
dictionary from my system, however, it works.

I tried workaround with a wrapper around hunspell that modifies the
output of `hunspell -D` and it works, but that's really ugly.

>Thanks.

Thank you,
Martin