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

> From: Eric Abrahamsen <eric@ericabrahamsen.net>
> Cc: 32319@debbugs.gnu.org
> Date: Wed, 01 Aug 2018 12:51:54 -0700
> 
> 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.

Does the patch below produce a useful diagnostic?

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

AFAIK, with Hunspell we get the default dictionary from Hunspell
itself, not from the user.

Here's the proposed patch, let me know what you think:

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index e77bc7e..321d7dd 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1180,6 +1180,8 @@ ispell-find-hunspell-dictionaries
     ;; Parse and set values for default dictionary.
     (setq hunspell-default-dict (or hunspell-multi-dict
 				    (car hunspell-default-dict)))
+    (or hunspell-default-dict
+        (error "Can't find Hunspell dictionary with an .aff affix file"))
     (setq hunspell-default-dict-entry
 	  (ispell-parse-hunspell-affix-file hunspell-default-dict))
     ;; Create an alist of found dicts with only names, except for default dict.





  reply	other threads:[~2018-08-04 11:02 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
2018-08-04 11:02         ` Eli Zaretskii [this message]
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=83ftzutmw4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=32319@debbugs.gnu.org \
    --cc=eric@ericabrahamsen.net \
    /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).