From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ian W Newsgroups: gmane.emacs.bugs Subject: bug#50370: Fix bug in ispell-init-process error handling Date: Sat, 4 Sep 2021 12:38:40 -0700 Message-ID: References: <6aeebcfa-8a3a-4668-987b-dbe665c514ad@Spark> <83h7f0wnxr.fsf@gnu.org> <83ilzguqtk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="6133cb49_60b6df70_53c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1247"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50370@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 04 22:07:16 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mMbwZ-00005d-S4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Sep 2021 22:07:16 +0200 Original-Received: from localhost ([::1]:34650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMbwY-0003nz-8p for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Sep 2021 16:07:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMbwN-0003nW-28 for bug-gnu-emacs@gnu.org; Sat, 04 Sep 2021 16:07:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37158) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mMbwM-00013N-RI for bug-gnu-emacs@gnu.org; Sat, 04 Sep 2021 16:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mMbwM-0000GR-GE for bug-gnu-emacs@gnu.org; Sat, 04 Sep 2021 16:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ian W Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Sep 2021 20:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50370 X-GNU-PR-Package: emacs Original-Received: via spool by 50370-submit@debbugs.gnu.org id=B50370.1630785976956 (code B ref 50370); Sat, 04 Sep 2021 20:07:02 +0000 Original-Received: (at 50370) by debbugs.gnu.org; 4 Sep 2021 20:06:16 +0000 Original-Received: from localhost ([127.0.0.1]:48704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMbvb-0000FM-Qq for submit@debbugs.gnu.org; Sat, 04 Sep 2021 16:06:16 -0400 Original-Received: from mail-pj1-f49.google.com ([209.85.216.49]:55082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMbVB-0005s5-AN for 50370@debbugs.gnu.org; Sat, 04 Sep 2021 15:39:01 -0400 Original-Received: by mail-pj1-f49.google.com with SMTP id fs6so1781360pjb.4 for <50370@debbugs.gnu.org>; Sat, 04 Sep 2021 12:38:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wahbe-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version; bh=u45I0e9xP2Dx/cnRNC/l7+YaPoYoJzzs4AlRzKjxtEA=; b=OpOCpBOXaJUyVosiv0yAzTLC+QUeYf9CO39QZZTSwl/HEnl43rcciLM7Y5t4RQMBjz fVF6Tfltj7KpLwdmT11rIuxAtcsB2Abx1M4esG3LRDk7hRJvIYxiv74NAUl3xQusGguf 5qo+4OB8mKCawiPN7fTpBsLjN6F9fV1QO67GGv2dT62euZvzrL95WmbhkaiFM/UHnqAw qU2SHq/i6oCdifhkJQMtkOX+kBFua3khwhJs/rwVeE1IRaW280zjlnviw+XmrfnVRNn/ 8er58uZlO4qFnN99g0Xiw2lLK/SjMY27oXwLJEgoFlq1OgDHnkYUbL4T/UNBstQOywCk dLGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to :references:subject:mime-version; bh=u45I0e9xP2Dx/cnRNC/l7+YaPoYoJzzs4AlRzKjxtEA=; b=JvxWk1GZsOxPBMMt3DvWG7yuIdrAaDjHybjrE1aWu/sR3zl8rKvz+Bt7ebNmcbL+a4 hi9kEcczvJWHigsh2m76tOvyj8KHeNcz5jYvq1FDhZYvyfzUrHbv6uiXcc7jIunhdguQ j6lRPcIPvQXW6zPqGNxXbUUEBInBQnl2CoP8omsN0qaInwE7IDvQaRDQlqly9SNW4emG CxWi6KQHh42VagFrzZ+ohnOC2w3Hl8+vYeEsZ0t1QpQE66Wjk+f7lVOKAIhMB8dt4gJV 9u/QEIKTzfOqL5fXtQnNNR6emMrvIxVjaUtiueKXF1Y9jHulRqt5c5NKmzR3JokAg0/q NVqQ== X-Gm-Message-State: AOAM531Nb9PUtb6DL1tW9ib3n5GvlhyyGFWaIHc0xpVQALYNIa+gV0Jj pVMUP8VJAu+U7WUQFlt34S7yaw== X-Google-Smtp-Source: ABdhPJxK1ldI4xxhbut/9ORnnjclnQ+eRM9laQGsXIfHAT1l4jUrG+gEoXlHhNW41BeSgourXlALEQ== X-Received: by 2002:a17:902:9008:b0:12d:8258:e07c with SMTP id a8-20020a170902900800b0012d8258e07cmr4355625plp.42.1630784331170; Sat, 04 Sep 2021 12:38:51 -0700 (PDT) Original-Received: from [192.168.7.54] (c-24-16-210-149.hsd1.wa.comcast.net. [24.16.210.149]) by smtp.gmail.com with ESMTPSA id o2sm3405292pgu.76.2021.09.04.12.38.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Sep 2021 12:38:50 -0700 (PDT) In-Reply-To: <83ilzguqtk.fsf@gnu.org> X-Readdle-Message-ID: bc736029-be4b-4617-a96d-78409e14e7ba@Spark X-Mailman-Approved-At: Sat, 04 Sep 2021 16:06:14 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:213439 Archived-At: --6133cb49_60b6df70_53c Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I think that hunspell is different. It validates that the dictionary real= ly exists in the beginning of ispell-start-process: (defun ispell-start-process () =C2=A0=22Start the Ispell process, with support for no asynchronous proce= sses. Keeps argument list for future Ispell invocations for no async support.=22= =C2=A0;; =60ispell-current-dictionary' and =60ispell-current-personal-dic= tionary' =C2=A0;; are properly set in =60ispell-internal-change-dictionary'. =C2=A0;; Parse hunspell affix file if using hunspell and entry is uniniti= alized. =C2=A0(if ispell-really-hunspell =C2=A0(or (cadr (assoc ispell-current-dictionary ispell-dictionary-alist)= ) =C2=A0(ispell-hunspell-fill-dictionary-entry ispell-current-dictionary)))= =E2=80=A6) Having seen this, I think that this will only be a problem for ispell and= aspell. I just tested the recipe and it works on =E2=80=9Cemacs -Q=E2=80= =9D=C2=A0=C2=A0(I have ispell installed correctly, and emacs defaults to = that). On Sep 4, 2021, 11:40 AM -0700, Eli Zaretskii , wrote: > =5BPlease use Reply All to keep the bug address on the CC list.=5D > > > Date: Sat, 4 Sep 2021 11:33:42 -0700 > > =46rom: Ian W > > > > I think it=E2=80=99s a better error message, but that is just my opin= ion. It tells me that ispell is trying to read an invalid > > dictionary file. In my case, I deleted that file and everything start= ed working. I also think it=E2=80=99s the error message > > intended to be displayed (by the ispell program and ispell package), = as it is the error message designed to > > help the user solve their problem. > > > > (t > > ;; Otherwise, it must be an error message. Show the user. > > ;; But first wait to see if some more output is going to arrive. > > ;; Otherwise we get cool errors like =22Can't open =22. > > (sleep-for 1) > > (ispell-accept-output 3) ;; <<< This is the line that errors >>> > > (error =22%s=22 (mapconcat =23'identity ispell-filter =22=5Cn=22)))) > > > > So the intended error message is never displayed. > > > > I=E2=80=99m sorry for not including a repo. I got it consistently bec= ause I had a bad file cached by aspell (or maybe > > doom). You also get the same message when you didn=E2=80=99t install = your dictionaries correctly. This is a problem > > in how ispell displays errors, so it=E2=80=99s consistent but only if= you already had a real problem with ispell. > > > > To repo: > > (setq ispell-local-dictionary-overridden t > > ispell-local-dictionary =22not-a-dict=22) > > > > This misconfigures your local dictionary, and ensures that the ispell= process will error on start. Then run > > ispell-word on any word. Thanks for the prompt response. > > With the above recipe, I get: > > ispell-phaf: No matching entry for not-a-dict in =E2=80=98ispell-hunspe= ll-dict-paths-alist=E2=80=99. > > (My speller is Hunspell.) > > So does this mean this problem doesn't happen with Hunspell=3F Ir is > the recipe incomplete or something=3F --6133cb49_60b6df70_53c Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
I think that hunspell is different. It validates th= at the dictionary really exists in the beginning of ispell-start-process:=

(defun ispell-start-process ()
&=23160;=22Start the Ispell process, with support for no asynchronous pro= cesses.
Keeps argument list for future Ispell invocations for no async support.=22=
&=23160;;; =60ispell-current-dictionary' and =60ispell-current-personal-d= ictionary'
&=23160;;; are properly set in =60ispell-internal-change-dictionary'.

&=23160;;; Parse hunspell affix file if using hunspell and entry is unini= tialized.
&=23160;(if ispell-really-hunspell
&=23160;(or (cadr (assoc ispell-current-dictionary ispell-dictionary-alis= t))
&=23160;(ispell-hunspell-fill-dictionary-entry ispell-current-dictionary)= ))
=E2=80=A6)

Having seen this, I think that this will only be a problem for ispell and= aspell. I just tested the recipe and it works on =E2=80=9Cemacs -Q=E2=80= =9D&=23160;&=23160;(I have ispell installed correctly, and emacs defaults= to that).&=23160;
On Sep 4, 2021, 11:40 AM -0700, Eli= Zaretskii <eliz=40gnu.org>, wrote:
=5BPlease use Reply All to keep the bug address on the CC list.= =5D

Date: Sat, 4 Sep 2021 11:33:42 -0700
=46rom: Ian W <ian=40wahbe.com>

I think it=E2=80=99s a better error message, but that is just my opinion.= It tells me that ispell is trying to read an invalid
dictionary file. In my case, I deleted that file and everything started w= orking. I also think it=E2=80=99s the error message
intended to be displayed (by the ispell program and ispell package), as i= t is the error message designed to
help the user solve their problem.

(t
;; Otherwise, it must be an error message. Show the user.
;; But first wait to see if some more output is going to arrive.
;; Otherwise we get cool errors like =22Can't open =22.
(sleep-for 1)
(ispell-accept-output 3) ;; <<< This is the line that errors >= ;>>
(error =22%s=22 (mapconcat =23'identity ispell-filter =22=5Cn=22))))

So the intended error message is never displayed.

I=E2=80=99m sorry for not including a repo. I got it consistently because= I had a bad file cached by aspell (or maybe
doom). You also get the same message when you didn=E2=80=99t install your= dictionaries correctly. This is a problem
in how ispell displays errors, so it=E2=80=99s consistent but only if you= already had a real problem with ispell.

To repo:
(setq ispell-local-dictionary-overridden t
ispell-local-dictionary =22not-a-dict=22)

This misconfigures your local dictionary, and ensures that the ispell pro= cess will error on start. Then run
ispell-word on any word. Thanks for the prompt response.

With the above recipe, I get:

ispell-phaf: No matching entry for not-a-dict in =E2=80=98ispell-hunspell= -dict-paths-alist=E2=80=99.

(My speller is Hunspell.)

So does this mean this problem doesn't happen with Hunspell=3F Ir is
the recipe incomplete or something=3F
--6133cb49_60b6df70_53c--