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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25825 in the body.
You can then email your comments to 25825 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Tue, 21 Feb 2017 04:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to S W <sw9 <at> outlook.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 21 Feb 2017 04:33:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: S W <sw9 <at> outlook.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 25.1; ispell-find-hunspell-dictionaries not working on Windows
Date: Tue, 21 Feb 2017 03:41:33 +0000
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''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1252

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
split-string: Wrong type argument: stringp, nil

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message idna dired format-spec rfc822
mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu
cl-loaddefs pcase cl-lib mail-prsvr mail-utils ispell time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
w32notify w32 multi-tty make-network-process emacs)

Memory information:
((conses 16 91762 3533)
 (symbols 56 20003 0)
 (miscs 48 91 84)
 (strings 32 17048 5055)
 (string-bytes 1 472329)
 (vectors 16 11965)
 (vector-slots 8 427043 5530)
 (floats 8 160 19)
 (intervals 56 284 37)
 (buffers 976 23))

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Wed, 26 Aug 2020 18:10:01 GMT) Full text and rfc822 format available.

Message #8 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: S W <sw9 <at> outlook.com>
Cc: 25825 <at> debbugs.gnu.org
Subject: Re: 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)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Wed, 26 Aug 2020 18:29:02 GMT) Full text and rfc822 format available.

Message #11 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
Subject: Re: bug#25825: 25.1;
 ispell-find-hunspell-dictionaries not working on Windows
Date: Wed, 26 Aug 2020 21:28:11 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Wed, 26 Aug 2020 11:09:21 -0700
> Cc: 25825 <at> debbugs.gnu.org
> 
> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Wed, 26 Aug 2020 18:35:01 GMT) Full text and rfc822 format available.

Message #14 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: stefan <at> marxist.se, sw9 <at> outlook.com
Cc: 25825 <at> debbugs.gnu.org
Subject: Re: bug#25825: 25.1;
 ispell-find-hunspell-dictionaries not working on Windows
Date: Wed, 26 Aug 2020 21:34:33 +0300
> Date: Wed, 26 Aug 2020 21:28:11 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
> 
> 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).

FWIW, my crystal ball says that OP's problem is a simple cockpit
error: the OP should copy en_US.aff and en_US.dic to ENU.aff and
ENU.doc, respectively, and things will start working.  This renaming
is needed because Windows locales are named using a different naming
scheme than on Posix hosts.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Wed, 26 Aug 2020 18:37:02 GMT) Full text and rfc822 format available.

Message #17 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: stefan <at> marxist.se
Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
Subject: Re: bug#25825: 25.1;
 ispell-find-hunspell-dictionaries not working on Windows
Date: Wed, 26 Aug 2020 21:36:33 +0300
> Date: Wed, 26 Aug 2020 21:28:11 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
> 
> > But the output from "hunspell -D" looks like this on my machine:
> > 
> >     $ hunspell -D

What does it show if you use

  $ hunspell -D /dev/null

Because the latter is how Emacs invokes Hunspell, note the null-device
part of the command we invoke.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Wed, 26 Aug 2020 18:49:01 GMT) Full text and rfc822 format available.

Message #20 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
Subject: Re: bug#25825: 25.1;
 ispell-find-hunspell-dictionaries not working on Windows
Date: Wed, 26 Aug 2020 11:48:12 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> 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?

Right, I'm using:

@(#) International Ispell Version 3.2.06 (but really Hunspell 1.7.0)

The man page says:

-D Show detected path of the loaded dictionary, and list of the search
 path and the available dictionaries.

>> (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?

It makes the intention clearer, and makes it slightly easier to debug.

As it stands, when you step through this, we begin with looking for
"SEARCH PATH:.aff".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Wed, 26 Aug 2020 18:49:02 GMT) Full text and rfc822 format available.

Message #23 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
Subject: Re: bug#25825: 25.1;
 ispell-find-hunspell-dictionaries not working on Windows
Date: Wed, 26 Aug 2020 11:48:20 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> What does it show if you use
>
>   $ hunspell -D /dev/null
>
> Because the latter is how Emacs invokes Hunspell, note the null-device
> part of the command we invoke.

Hmm... So there is an error which is not there for "hunspell -D".

I'll investigate.

$ hunspell -D /dev/null
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
Can't open affix or dictionary files for dictionary named "default".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Wed, 26 Aug 2020 19:00:01 GMT) Full text and rfc822 format available.

Message #26 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
Subject: Re: bug#25825: 25.1;
 ispell-find-hunspell-dictionaries not working on Windows
Date: Wed, 26 Aug 2020 21:59:18 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Wed, 26 Aug 2020 11:48:20 -0700
> Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
> 
> 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
> Can't open affix or dictionary files for dictionary named "default".

Looks like you have an installation problem: there's no default.dic on
your system.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Wed, 26 Aug 2020 19:22:01 GMT) Full text and rfc822 format available.

Message #29 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
Subject: Re: bug#25825: 25.1;
 ispell-find-hunspell-dictionaries not working on Windows
Date: Wed, 26 Aug 2020 12:21:02 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> Looks like you have an installation problem: there's no default.dic on
> your system.

It seems to be an issue with my environment.  I've been using this for a
very long time:

    $ locale
    LANG=
    LANGUAGE=
    LC_CTYPE=sv_SE.UTF-8
    LC_NUMERIC="POSIX"
    LC_TIME=C
    LC_COLLATE=C
    LC_MONETARY="POSIX"
    LC_MESSAGES="POSIX"
    LC_PAPER="POSIX"
    LC_NAME="POSIX"
    LC_ADDRESS="POSIX"
    LC_TELEPHONE="POSIX"
    LC_MEASUREMENT="POSIX"
    LC_IDENTIFICATION="POSIX"
    LC_ALL=

But for some reason, hunspell is very sensitive and will not give any
loaded dictionary if $LANG is unset.  (IMO, very unhelpful behaviour.)

This gives the expected output:

    $ export LANG=en_US.UTF-8
    $ hunspell -D /dev/null
    SEARCH PATH:
    [[...snipped...]]
    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
    LOADED DICTIONARY:
    /usr/share/hunspell/en_US.aff
    /usr/share/hunspell/en_US.dic

One idea to improve the situation on our end is to look for "Can't
open affix or dictionary files for dictionary named 'default'." and
raise a better error in these cases.

Or, if we want to really go out of our way, we could retry with
"LANG=en_US.UTF-8".

WDYT?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Wed, 26 Aug 2020 19:41:01 GMT) Full text and rfc822 format available.

Message #32 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
Subject: Re: bug#25825: 25.1;
 ispell-find-hunspell-dictionaries not working on Windows
Date: Wed, 26 Aug 2020 22:39:57 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Wed, 26 Aug 2020 12:21:02 -0700
> Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
> 
> But for some reason, hunspell is very sensitive and will not give any
> loaded dictionary if $LANG is unset.  (IMO, very unhelpful behaviour.)

Maybe this is worth a bug report against Hunspell.  But is this really
relevant to how Hunspell is invoked from Emacs?  It certainly isn't on
Windows, because we inject LANG into the environment there.  But what
about Posix hosts?

> One idea to improve the situation on our end is to look for "Can't
> open affix or dictionary files for dictionary named 'default'." and
> raise a better error in these cases.

Fine with me.

> Or, if we want to really go out of our way, we could retry with
> "LANG=en_US.UTF-8".

That cannot fly: we cannot second-guess the user's locale, and we
shouldn't force some arbitrary locale on them.  It's basically a
mis-configured system, so signaling an error is good enough, IMO.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Wed, 26 Aug 2020 20:02:01 GMT) Full text and rfc822 format available.

Message #35 received at 25825 <at> debbugs.gnu.org (full text, mbox):

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

> It seems to be an issue with my environment.  I've been using this for a
> very long time:
>
>     $ locale
>     LANG=

So, I looked into all my locale stuff again, and it turns out that $LANG
was unintentionally left unset here for boring reasons.  (There is no
reason to leave $LANG unset.)

> One idea to improve the situation on our end is to look for "Can't
> open affix or dictionary files for dictionary named 'default'." and
> raise a better error in these cases.

I think it's better to raise the more helpful error.

How does the attached diff look?
[bug-25825-2.diff (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Wed, 26 Aug 2020 20:11:01 GMT) Full text and rfc822 format available.

Message #38 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
Subject: Re: bug#25825: 25.1;
 ispell-find-hunspell-dictionaries not working on Windows
Date: Wed, 26 Aug 2020 13:10:13 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

>> But for some reason, hunspell is very sensitive and will not give any
>> loaded dictionary if $LANG is unset.  (IMO, very unhelpful behaviour.)
>
> Maybe this is worth a bug report against Hunspell.

I filed a bug report against hunspell here:

    https://github.com/hunspell/hunspell/issues/687

> But is this really relevant to how Hunspell is invoked from Emacs?  It
> certainly isn't on Windows, because we inject LANG into the
> environment there.  But what about Posix hosts?

AFAIU, we just inherit the environment such that if $LANG is unset in
the parent process,

    (getenv "LANG") => nil

> That cannot fly: we cannot second-guess the user's locale, and we
> shouldn't force some arbitrary locale on them.  It's basically a
> mis-configured system, so signaling an error is good enough, IMO.

Point taken.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Thu, 27 Aug 2020 03:28:02 GMT) Full text and rfc822 format available.

Message #41 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
Subject: Re: bug#25825: 25.1;
 ispell-find-hunspell-dictionaries not working on Windows
Date: Thu, 27 Aug 2020 06:27:27 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Wed, 26 Aug 2020 13:01:21 -0700
> Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
> 
> > One idea to improve the situation on our end is to look for "Can't
> > open affix or dictionary files for dictionary named 'default'." and
> > raise a better error in these cases.
> 
> I think it's better to raise the more helpful error.
> 
> How does the attached diff look?

It's OK, but wouldn't it be more helpful if we added something like

  (is $LANG unset?)

to the error message text?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Thu, 27 Aug 2020 03:53:02 GMT) Full text and rfc822 format available.

Message #44 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org
Subject: Re: bug#25825: 25.1;
 ispell-find-hunspell-dictionaries not working on Windows
Date: Wed, 26 Aug 2020 20:51:58 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> It's OK, but wouldn't it be more helpful if we added something like
>
>   (is $LANG unset?)
>
> to the error message text?

I actually had that at first but removed it for brevity.

But I guess it's worth being more helpful in this exceptional
circumstance, so I'll add it back in.  Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Thu, 27 Aug 2020 04:34:01 GMT) Full text and rfc822 format available.

Message #47 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>, sw9 <at> outlook.com
Cc: 25825 <at> debbugs.gnu.org
Subject: Re: bug#25825: 25.1;
 ispell-find-hunspell-dictionaries not working on Windows
Date: Wed, 26 Aug 2020 21:32:59 -0700
tags 25825 + moreinfo
thanks

Eli Zaretskii <eliz <at> gnu.org> writes:

>> 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).
>
> FWIW, my crystal ball says that OP's problem is a simple cockpit
> error: the OP should copy en_US.aff and en_US.dic to ENU.aff and
> ENU.doc, respectively, and things will start working.  This renaming
> is needed because Windows locales are named using a different naming
> scheme than on Posix hosts.

S W, could you please try the above and see if that resolves your
problem?

Thanks in advance.

Best regards,
Stefan Kangas




Added tag(s) moreinfo. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 27 Aug 2020 04:34:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25825; Package emacs. (Tue, 24 Nov 2020 08:45:01 GMT) Full text and rfc822 format available.

Message #52 received at 25825 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: sw9 <at> outlook.com, 25825 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#25825: 25.1; ispell-find-hunspell-dictionaries not working
 on Windows
Date: Tue, 24 Nov 2020 09:43:54 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> S W, could you please try the above and see if that resolves your
> problem?

This was months ago, and there was no response, so it seems unlikely
that there'll be further progress here, and I'm closing this bug report.
If further progress can be made, please respond to the debbugs address
and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 25825 <at> debbugs.gnu.org and S W <sw9 <at> outlook.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 24 Nov 2020 08:45:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 22 Dec 2020 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 122 days ago.

Previous Next


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