unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 32319@debbugs.gnu.org
Subject: bug#32319: 27.0.50; flyspell-mode error on start
Date: Wed, 01 Aug 2018 12:51:54 -0700	[thread overview]
Message-ID: <87d0v1vp9h.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <83effiocc9.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 01 Aug 2018 09:00:38 +0300")


On 08/01/18 09:00 AM, Eli Zaretskii wrote:
>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>> Date: Tue, 31 Jul 2018 19:03:26 -0700
>> 
>> But! This was a false alarm: the problem is a bug in the hunspell_en
>> package for Arch linux, which is missing some symlinks, and causing
>> several other programs to fail: 
>> 
>> https://bugs.archlinux.org/task/59401
>
> So the problem was that the files en_US.*, which spell-checking was
> supposed to use, didn't exist, is that right?

That's correct. My LANG is set to en_US.UTF-8, so I guess hunspell
automatically tries to load the en_US dictionary. With the correct
symlink in place, "hunspell -D" produces:

SEARCH PATH:
.:: <elided>
AVAILABLE DICTIONARIES
/usr/share/hunspell/en_TT
<more>
LOADED DICTIONARY:
/usr/share/hunspell/en_US.aff
/usr/share/hunspell/en_US.dic

`ispell-find-hunspell-dictionaries' cycles over each line of the above
output and looks for "\\.aff$" (ispell.el:1120). If it finds it, the
local variable `hunspell-default-dictionary' is set from that value,
which eventually finds its way into `ispell-hunspell-dictionary-alist',
and things proceed normally from there.

If the symlink is not present, the "hunspell -D" output looks like:

SEARCH PATH:.:: <elided>
AVAILABLE DICTIONARIES
/usr/share/hunspell/en_TT
<more>
Can't open affix or dictionary files for dictionary named "en_US".

IOW, there's no line that matches "\\.aff$", and
`hunspell-default-dictionary' is never set, and the error is raised in
line 1177, where it's assumed that that variable has a value.

So things go wrong pretty early on, as soon as Hunspell fails to load a
dictionary.

>> It might have been nice if ispell allowed the real error to reach me
>> (during edebugging I did see something like "no affix file found for
>> "en_US""), but I suppose it isn't a big deal.
>
> At some point in the initialization, ispell.el looks for the
> dictionary file, and if not found, falls back to a user option (which
> was nil in your case).  Can you spot where both are nil, and propose a
> patch in that place to display a warning or error message?

I suppose if the user has asked to use Hunspell, and Hunspell has failed
to load a dictionary, we should bail with a warning at that stage?

Alternately, I tried wrapping lines 1176-1180, at the bottom of
`ispell-find-hunspell-dictionaries', in a (when
hunspell-default-dictionary ...), so that essentially nothing gets set.
When I then ran `ispell-buffer', I got:

Can't open affix or dictionary files for dictionary named "en_US".

Which is the error returned by hunspell itself, and useful information.

What I didn't test was whether having a user option in place, specifying
a dictionary to use, would prevent even that error from being signaled.
Mostly because I don't know which option that would be -- I find the
proliferation of dictionary-holding variables pretty confusing. But I
suppose the ideal situation would be: having a valid option set would
swallow the error and allow the process to continue as normal.

Eric





  reply	other threads:[~2018-08-01 19:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-30 19:42 bug#32319: 27.0.50; flyspell-mode error on start Eric Abrahamsen
2018-07-31 15:33 ` Eli Zaretskii
2018-08-01  2:03   ` Eric Abrahamsen
2018-08-01  6:00     ` Eli Zaretskii
2018-08-01 19:51       ` Eric Abrahamsen [this message]
2018-08-04 11:02         ` Eli Zaretskii
2018-08-05  5:21           ` Eric Abrahamsen
2018-08-11  7:36             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d0v1vp9h.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=32319@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).