From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67857: 30.0.50; ispell fails on apostrophes when the dictionary includes contractions Date: Sun, 17 Dec 2023 08:59:42 +0200 Message-ID: <83a5q9l3fl.fsf@gnu.org> References: <25982.4274.795598.983142@orion.rgrjr.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13906"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67857@debbugs.gnu.org To: Bob Rogers Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 17 08:01:33 2023 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 1rEl9Z-0003Ri-HP for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Dec 2023 08:01:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEl96-0002Sa-Bw; Sun, 17 Dec 2023 02:01:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rEl94-0002Rz-39 for bug-gnu-emacs@gnu.org; Sun, 17 Dec 2023 02:01:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rEl92-00069W-Of for bug-gnu-emacs@gnu.org; Sun, 17 Dec 2023 02:01:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rEl93-0000Og-Q9 for bug-gnu-emacs@gnu.org; Sun, 17 Dec 2023 02:01:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Dec 2023 07:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67857 X-GNU-PR-Package: emacs Original-Received: via spool by 67857-submit@debbugs.gnu.org id=B67857.170279641126910 (code B ref 67857); Sun, 17 Dec 2023 07:01:01 +0000 Original-Received: (at 67857) by debbugs.gnu.org; 17 Dec 2023 07:00:11 +0000 Original-Received: from localhost ([127.0.0.1]:56536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEl8E-0006z2-AR for submit@debbugs.gnu.org; Sun, 17 Dec 2023 02:00:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEl89-0006VX-OF; Sun, 17 Dec 2023 02:00:08 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rEl83-0005bF-22; Sun, 17 Dec 2023 01:59:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=9SoChG7wRvBZebcid4wT3emXpq5NFD3pBfzM3x4SRao=; b=c0sq9PmSRHdF xhRfBu9oZDtBVs+Be0U2kFRh4zBxPrP8a+TYnE4hmRhscTDv/VG2EC2XUUwsunNMI4RUXID7jyhwi A6t88TSl5wy2irEef9M8T95O/3tq9Dq6SUTY5WoQeuP8NxDkvTLHzldZCqK9Tj+U9XXGuo1l0avLf 9vEZ4dLBWzYxBSs1NkC1qw+R72ubQbofynLt5VGvN3+fp8YdVafItbSH90j0qNX8hxZBIPOtveMuv cDAWlT0CSgwmetK07EPWWqhVnAGvTG+85Xd0pJ1Z4t1QeTpmJHDT0NdKqZYap49hWk/XAJPx5Zh6U +HyHnXdW9C9jm48yoNblJw==; In-Reply-To: <25982.4274.795598.983142@orion.rgrjr.com> (message from Bob Rogers on Sat, 16 Dec 2023 13:03:46 -0800) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276407 Archived-At: tags 67857 notabug thanks > Date: Sat, 16 Dec 2023 13:03:46 -0800 > From: Bob Rogers > > 1. "emacs -Q" (in an environment that uses hunspell by default). > > 2. In the *scratch* buffer, type "this wiouldn't work". > > 3. Type M-b three times to move point before the "w" in the second > word. > > 4. Type M-$. The sole offered replacement is "wouldn't" but the > text it offers to replace is "wiouldn"; typing "0" to take the > replacement results in "this wouldn't't work" in the buffer. Doesn't happen for me. > On my system, the value of ispell-really-hunspell is "1.6.2"; I use Hunspell 1.3.2, FWIW. > further > configuration data appear below. The problem seems to be that the > dictionary hunspell is using contains contractions, but ispell is > expecting just [:alpha:] words. I tried tweaking the regexps in > ispell-dictionary-alist to accept apostrophes, but got the error: > > ispell--run-on-word: Ispell and its process have different > character maps: (* & wiouldn 1 1: wouldn't) > > It seems like a job tailor-made for OTHERCHARS, but I get the same error > whether I add the apostrophe to OTHERCHARS via > > (setf (nth 3 (assoc nil ispell-dictionary-alist)) "['0-9]") > > or to CASECHARS and NOT-CASECHARS in tandem, via (e.g.): > > (setf (nth 1 (assoc nil ispell-dictionary-alist)) "['[:alpha:]]") > > I do not understand how to get past this point, so either the code is > failing somehow (and I appreciate that it might be hard to glean the > right config bits for the dictionar(y|ies) in use), I am missing or > misunderstanding some part of the documentation, or the documentation is > lacking. TIA, You are looking at the wrong places to try fixing this. First, the default for OTHERCHARS in English and American dictionaries is "[']" (see ispell-dictionary-base-alist), and likewise for the "default" dictionary, so this already includes the apostrophe. However, when ispell.el uses Hunspell, it doesn't use this database for OTHERCHARS; instead, it looks in the dictionary's affix file, see ispell-parse-hunspell-affix-file. So you should look in your affix file and see if the apostrophe is mentioned there. In my affix file for English, I see this line: WORDCHARS 0123456789' which includes the apostrophe. See hunspell(4) man page for more details about the affix file and its settings. My affix file also has this line, which also includes the apostrophe: TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ'- Not sure if it's relevant, but I though I'd mention it for completeness. I see no bug in Emacs here. ispell.el works as intended.