Subject: bug#25825: 25.1; ispell-find-hunspell-dictionaries not working on Windows

From: Eli Zaretskii <[email-masked]>
Date: Wed, 26 Aug 2020 21:28:11 +0300

> From: Stefan Kangas <[email-masked]>
> Date: Wed, 26 Aug 2020 11:09:21 -0700
> Cc: [email-masked]
> 
> Looking at `ispell-find-hunspell-dictionaries', I don't see how it would
> work at all.  It is using the output from "hunspell -D", and will only
> set the local variable `hunspell-default-dict' if any of the output
> lines match ".aff$".
> 
> But the output from "hunspell -D" looks like this on my machine:
> 
>     $ hunspell -D
>     SEARCH PATH:
>     .::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/home/skangas/.openoffice.org/3/user/wordbook:/home/skangas/.openoffice.org2/user/wordbook:/home/skangas/.openoffice.org2.0/user/wordbook:/home/skangas/Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo
>     AVAILABLE DICTIONARIES (path is not mandatory for -d option):
>     /usr/share/hunspell/en_US
>     /usr/share/hunspell/sv_FI
>     /usr/share/hunspell/sv_SE
>     /home/skangas/.openoffice.org/3/user/wordbook/standard

Hunspell is supposed to display this at the end of the "available
dictionaries" output:

  LOADED DICTIONARY:
  /usr/share/hunspell/default.aff
  /usr/share/hunspell/default.dic

(The "default" part can be different in your case.)

The Hunspell I have does show this.  If yours doesn't, perhaps they've
changed the output in later versions, in which case we need to figure
out how to force the newer Hunspell to output the loaded dictionary.
Because just knowing what dictionaries are available is not enough.

So please read the man page for Hunspell you have, and tell how to ask
Hunspell for that missing part.  Note that the code already includes a
quirk for Hunspell 1.7.0, maybe it doesn't work with later versions?

In any case, this cannot be the reason for the OP's problem, because
he evidently uses the same version of Hunspell that I do (the
ezwinports site is where I upload the ports I use myself).

> (I would also suggest to install the attached patch to immediately
> filter out the useless lines "SEARCH PATH", "AVAILABLE DICTIONARIES",
> etc.)

I don't think I understand the reason.  Why should we care what else
does Hunspell output in this case?