GNU bug report logs - #25825
25.1; ispell-find-hunspell-dictionaries not working on Windows

Previous Next

Package: emacs;

Reported by: S W <sw9 <at> outlook.com>

Date: Tue, 21 Feb 2017 04:33:01 UTC

Severity: normal

Tags: moreinfo

Found in version 25.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefan <at> marxist.se>
To: S W <sw9 <at> outlook.com>
Cc: 25825 <at> debbugs.gnu.org
Subject: bug#25825: 25.1; ispell-find-hunspell-dictionaries not working on Windows
Date: Wed, 26 Aug 2020 11:09:21 -0700
[Message part 1 (text/plain, inline)]
S W <sw9 <at> outlook.com> writes:

> I am using hunspell 1.3.2 on Windows from ezwinports.
> ispell-find-hunspell-dictionaries isn't setting
> ispell-hunspell-dictionary-alist properly because I believe LANG=ENU
> is overriding the default dictionary. This results in "Can't open
> affix or dictionary files for dictionary named \"ENU\" appearing in
> hunspell-found-dicts instead of "default.aff", which results in
> hunspell-default-dict being set to nil and an error when
> ispell-parse-hunspell-affix-file(hunspell-default-dict) is called.
>
> To reproduce in emacs -q
> (setq ispell-program-name "path_to_hunspell")
> M-x ispell-buffer
>
> In GNU Emacs 25.1.1 (x86_64-w64-mingw32)
>  of 2016-11-15 built on LAPHROAIG
> Windowing system distributor 'Microsoft Corp.', version 10.0.14393
> Configured using:
>  'configure --without-dbus --without-compress-install 'CFLAGS=-O2
>  -static -g3''

First, I can reproduce the issue using current master on Debian
GNU/Linux (bullseye/sid) with the following steps:

    0. emacs -Q
    1. (setq ispell-program-name "hunspell")
    2. M-x ispell-buffer

The error is "Can't find Hunspell dictionary with a .aff affix file" and
comes from `ispell-find-hunspell-dictionaries'.

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

So we never set `hunspell-default-dict', and we therefore barf here:

    (or hunspell-default-dict
        (error "Can't find Hunspell dictionary with a .aff affix file"))

Eli, I see that you have done some work here, could you perhaps shed
some light on how this is all supposed to work?

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

Best regards,
Stefan Kangas
[bug-25825.diff (text/x-diff, attachment)]

This bug report was last modified 4 years and 183 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.