From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#32319: 27.0.50; flyspell-mode error on start Date: Wed, 01 Aug 2018 12:51:54 -0700 Message-ID: <87d0v1vp9h.fsf@ericabrahamsen.net> References: <87o9eoldcv.fsf@ericabrahamsen.net> <834lgfpggw.fsf@gnu.org> <87600ug7wx.fsf@ericabrahamsen.net> <83effiocc9.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1533153071 4416 195.159.176.226 (1 Aug 2018 19:51:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 1 Aug 2018 19:51:11 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 32319@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 01 21:51:07 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fkx9F-00012q-Sg for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Aug 2018 21:51:06 +0200 Original-Received: from localhost ([::1]:42668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkxBM-0002Gk-9q for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Aug 2018 15:53:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkxBD-0002GX-Cd for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2018 15:53:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkxB9-0003Aa-Ec for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2018 15:53:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:32932) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fkxB9-0003AU-AA for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2018 15:53:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fkxB8-000851-RF for bug-gnu-emacs@gnu.org; Wed, 01 Aug 2018 15:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Aug 2018 19:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32319 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32319-submit@debbugs.gnu.org id=B32319.153315312430992 (code B ref 32319); Wed, 01 Aug 2018 19:53:02 +0000 Original-Received: (at 32319) by debbugs.gnu.org; 1 Aug 2018 19:52:04 +0000 Original-Received: from localhost ([127.0.0.1]:37950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fkxAC-00083o-4X for submit@debbugs.gnu.org; Wed, 01 Aug 2018 15:52:04 -0400 Original-Received: from mail.ericabrahamsen.net ([50.56.99.223]:51041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fkxAA-00083R-6F for 32319@debbugs.gnu.org; Wed, 01 Aug 2018 15:52:02 -0400 Original-Received: from localhost (97-113-227-87.tukw.qwest.net [97.113.227.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 226B1C1FFB; Wed, 1 Aug 2018 19:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1533153121; bh=08E+2d9MkacuUl1FDkrx37MsZhBn/k5H0YdtEdpAdbI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iL+CUvXpt+9mq1tEcVY0CtlP2ZnSWSkQc7OKT96TU90uVJSjC/bitqswkUqT/e/mk mhAoRbmSzPbCFEPQbuIspYQ2o46kfEN2Th6/Q+pALK02DFBITyxukmRrnszdJf2FIk FduccJX5e2mpRgVwP7nOohvTr9GQf391mwV5qyxE= In-Reply-To: <83effiocc9.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 01 Aug 2018 09:00:38 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:149179 Archived-At: On 08/01/18 09:00 AM, Eli Zaretskii wrote: >> From: Eric Abrahamsen >> 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: .:: AVAILABLE DICTIONARIES /usr/share/hunspell/en_TT 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:.:: AVAILABLE DICTIONARIES /usr/share/hunspell/en_TT 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