From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tor Kringeland Newsgroups: gmane.emacs.bugs Subject: bug#52179: Highlighting a word in `ispell' using `enchant' Date: Tue, 24 May 2022 15:49:45 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_OL1P279MB0194988AA408911D0B9BB38C88D79OL1P279MB0194NORP_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2292"; mail-complaints-to="usenet@ciao.gmane.io" To: "52179@debbugs.gnu.org" <52179@debbugs.gnu.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 24 19:30:39 2022 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 1ntYMg-0000MP-IS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 May 2022 19:30:38 +0200 Original-Received: from localhost ([::1]:44180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntYMf-0001dh-Dq for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 May 2022 13:30:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntYM7-0001br-AB for bug-gnu-emacs@gnu.org; Tue, 24 May 2022 13:30:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59357) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntYM7-0007Bz-1g for bug-gnu-emacs@gnu.org; Tue, 24 May 2022 13:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ntYM6-0002KS-UH for bug-gnu-emacs@gnu.org; Tue, 24 May 2022 13:30:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Tor Kringeland Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 May 2022 17:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52179 X-GNU-PR-Package: emacs Original-Received: via spool by 52179-submit@debbugs.gnu.org id=B52179.16534133768895 (code B ref 52179); Tue, 24 May 2022 17:30:02 +0000 Original-Received: (at 52179) by debbugs.gnu.org; 24 May 2022 17:29:36 +0000 Original-Received: from localhost ([127.0.0.1]:53254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntYLe-0002JN-2J for submit@debbugs.gnu.org; Tue, 24 May 2022 13:29:36 -0400 Original-Received: from mailgw201.it.ntnu.no ([129.241.56.178]:60654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntWn7-00064t-1w for 52179@debbugs.gnu.org; Tue, 24 May 2022 11:49:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntnu.no; i=@ntnu.no; q=dns/txt; s=s1-1909-ntnu; t=1653407386; h=from : to : subject : date : message-id : content-type : mime-version : from; bh=OQwFb9naigTwFZZMe5rpZ9q4OqjEj6ja9oa85P2HXOI=; b=M7H/VDq5KsCuB1rmyLDbx2xlsWgpH5TE4al0nIpbcuFs+WZ4BOBvXWtMl/svXTq6x7tHx abCEo6slf2eeWnHzuSuz2KV6G1QfEU0RZNhfzppzl1EudQ6zP2bKAPwmaj4Edz0ZK8w7baV /aZMBCaTMIXWpCcRL+L+8Q+iQycfWdhFGf5YzZa8mqiD+wq52ewxgU4q1x9Cma1ef+s+bD0 DkxMiXzTx04Kl5/7vWFeTIeqK5EvqNmFCLwLIE4xtDjqFNt5UTeK9C/z9jSb00VPYI8dhJF gUoa3Py02yqt2/q5IiOqAI+KZgP9/2swB4ESnxl8kBgM6mKOu1vDmjp2lb2g== Original-Received: from localhost (localhost [127.0.0.1]) by mailgw201.it.ntnu.no (Postfix) with ESMTP id E1CC7906968 for <52179@debbugs.gnu.org>; Tue, 24 May 2022 17:49:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mailgw201.it.ntnu.no Authentication-Results: mailgw201.it.ntnu.no (amavisd-new); dkim=pass (1024-bit key) header.d=studntnu.onmicrosoft.com Original-Received: from mailgw201.it.ntnu.no ([127.0.0.1]) by localhost (mailgw201.it.ntnu.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WfiBaOdltvv1 for <52179@debbugs.gnu.org>; Tue, 24 May 2022 17:49:46 +0200 (CEST) Original-Received: from NOR01-SV0-obe.outbound.protection.outlook.com (mail-sv0nor01lp20206.outbound.protection.outlook.com [IPv6:2a01:111:f403:7002::206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailgw201.it.ntnu.no (Postfix) with ESMTPS id 68561905EBF for <52179@debbugs.gnu.org>; Tue, 24 May 2022 17:49:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gPyDQp5qasNr4azFQVCfmNduX86J03/V7vTyhhQSR6ctd15DFuXi+9WQz9a3st/jAAWFZ5J0u1kTkdKd3kYjs/IgC8KfR46UMzAo7Kej/FE6N1b6O/hFuYNv8jBhQLwVZcagGWR0HZeO2ZNPDBD9HJe5pSdNMEXtnw4t97h7MAScptqpNqG1OOmjPdTcG3zu8U9aA8Pgtu4bQqAI/NkM1Sc66IcL+qkg74K5UImnR/cJg+y+mi9EnHt7fAStFu+SNR94K7ZZO2o1fSIy3CQI0q2i6hjhBdXcfiSYrXrtpR8KEEgVB2eNCw2VEvS/epfnqWAD6iRezFIyrwXXCNK4rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OQwFb9naigTwFZZMe5rpZ9q4OqjEj6ja9oa85P2HXOI=; b=C6Rxv8RoBTh2Ml0uXlh5sis4W1aY30Vr/J9JnxWOwpRg/mJsAK9aaAtlEcHxoYxjcIcl2CJDN+AkD0sbyEAoVagaY8/NppdOAAHbqmGiPBjCSyMmvQGzl5hrMXd0+NxUfHgcemk82KAD1Lhb3iKQzB3zCpwjS5UzP+y7XyoRJGEaut/3dxdP0KGwbIbrultvFNzbTJWVbTWLkX+y9+Jomu2VPc/z1EZib24YejsGtWt0IJIEC670YC9SNeP34l1v+dcghJf7fw1zET659chGXeNnY7gFZCiGy0/SJgsxGXi56kAaq6ULHAunyNLu3aznJL/MruqHHtVoU8ka+CXsfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ntnu.no; dmarc=pass action=none header.from=ntnu.no; dkim=pass header.d=ntnu.no; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=studntnu.onmicrosoft.com; s=selector2-studntnu-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OQwFb9naigTwFZZMe5rpZ9q4OqjEj6ja9oa85P2HXOI=; b=UvnBGDDa54uIig6+iKcyA7QMH7ngY3IV30kOGdjc8Q5hmQQmLm4x4dTc82KeXMt9DG03sXLmEnUTK3CIZKVzgk7kphb9wGwmAqPVlr8ZwyoMa6f+lYYxfaXhPKbAZQTL020+SEXtNC1baTC/E09nH9c+oYkrc5qfDDnqTdnb5ac= Original-Received: from OL1P279MB0194.NORP279.PROD.OUTLOOK.COM (2603:10a6:e10:11::15) by SV0P279MB0044.NORP279.PROD.OUTLOOK.COM (2603:10a6:f10:d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Tue, 24 May 2022 15:49:45 +0000 Original-Received: from OL1P279MB0194.NORP279.PROD.OUTLOOK.COM ([fe80::6533:db8c:602f:62aa]) by OL1P279MB0194.NORP279.PROD.OUTLOOK.COM ([fe80::6533:db8c:602f:62aa%6]) with mapi id 15.20.5273.023; Tue, 24 May 2022 15:49:45 +0000 Thread-Topic: Highlighting a word in `ispell' using `enchant' Thread-Index: AQHYb4PhMvijZ4fCrUWyEJYchL+llg== Accept-Language: en-US Content-Language: en-US suggested_attachment_session_id: a302ac17-2710-fca0-6240-aa86b158e626 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ntnu.no; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7371d8dc-9fec-4651-4347-08da3d9d0687 x-ms-traffictypediagnostic: SV0P279MB0044:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3hDHG26Ph652+T/M4rlHeGF/DRu2xjVe3cBvyPK0yLmOxkdwov4pSaNKr3BxlWGwUZU6uHPWhLwbt4AjuBypdVKiVWWbGvMTdxz7hhvOIMBZpQo8vxVSwIbbXixRClkPwZ+kn/U/ZcPmNquxaylT1xQwZSFdcAZl/N3DFiz0ixenKFdVMhwk8J17cqKIhapCCN2/iuDoYgtGPwe5++BoAY5YFCpuge5tXPaywOffAeXWK0oAIluO59u6zzVK/n+rtqeaz18IX/Hq1Sk8z6w2Jjz3AGd5YrhQpKGht5svzXmQikY6m8Nk5WSFqxuIHdHp6uhNzzkEKjhFasZFAICEi3J95pYV8kK2rakTJjECpf0731tsjCV8zOGCLPOMwohQvCcHs/sIByc9gKB623VWTXcI+fxRswfZXoCjKSp8Ud9i6opKaNc2ZaYVNB/GD8bn/Gqft4X3fsJgsqstG1VfANPF0aqhuGOramSWtpSO0/QFqunHgEOXLnQGXBCCZYX0FE2hdFDkABJrlcXXVSolMsderyQDpcopXJ+k1FkrzU/H/SHnPS9CH/OIOxou+edSWhTkL6xxfl+8RAwg0kSff2CCh+Dv2zf7kdSlAzVKuj+HDHTG9nsDapdHw3nJmw01arwqE0dE6e8VcsG9/ERqvBQjk/GF4BnQgodUUp4wDTHmlG2ThBQiy32HnfAd5VfzNSfn36ZZAF9y0pw37A7vH+w45px9/zPDN7sOhSyl8q0= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OL1P279MB0194.NORP279.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(186003)(76116006)(38070700005)(55016003)(122000001)(38100700002)(7696005)(6506007)(91956017)(66946007)(508600001)(64756008)(6916009)(66556008)(786003)(316002)(66476007)(66446008)(2906002)(71200400001)(26005)(8676002)(44832011)(4744005)(5660300002)(9686003)(52536014)(33656002)(8936002)(86362001)(19627405001)(81973001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: KUuf4fYHJSadv9Kt+jRtWGX5AbBdJztxrlhp9Pmxchy4SMMbJZAQzLMqtIP1V4gkS6lLJWAzBpezzJNcjghHvL1DslcUoTdcDpQE56CsjlToMQ6GpdlfsFbHupkFe9SK5UzLZcQKRWNzNhOXfNyE2NRTaQZb1dK5qj/UI/Vx8Iw2oiSRVjf1GbGIeNDa0OOCDFgJYTWk+QnT5ZmOe+EzGQtU3Uv6hzv3DVjJFNDx4ofYBqIIvgUlOuKJXeYb1hgczQ1/tks27kswzgtfJRg2r2iglHYsVD8rkDPH0ziv8dmERj/uNfpoqx7e1B0FFz78iVEBEOFPRfKntbWCPFJUf5uruh157vU405J4l7C4RFA+v85VsAZ4jXjI7bY3xRo9IjvePDiP3rnwiIRFgcf0lVvQtpsp1589z5+SMCNBNbwqNM2x2YQNkPqSRupvcc5vRTI6KYbw2OpcU0RXd0B9pcRhwI0zODQX5MnFWoz6uYtnHyPVzYmCFZTh/jS2Sp0p6e8R96MMccU6m7bZMy1IkSUYP2JX6pc8FD1oEMst51SM4QbR8orEiU4ICjbc9vbqrzRDLNiWJNKRXjiDTbqLjHT8ViPofvMYYCk3pV4IyTTQZYtOWX6nU2rgNu57qH7Kp2Qrlfen9YPQ07cVxmjYfgCALIv1UZJz92jD3PdEzuAkvvItKz5q6BWIUfwwL0QgyHLoRwWr9IAvBfWNZL0fEwLUCKifsth5shpwcQ/AK/PSGTs1R41eSQMe3X ljAAt5+JvMXLIPcjwJNwpEwrgt7XdOGxJgJPURuMoyTZvHoqEH7kNEgLuZc2hSDjHRDcbROUEcMien0r1ATElRjyFZJ5MRGmj8 X-OriginatorOrg: ntnu.no X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: OL1P279MB0194.NORP279.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 7371d8dc-9fec-4651-4347-08da3d9d0687 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2022 15:49:45.4409 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 09a10672-822f-4467-a5ba-5bb375967c05 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Li4g00oVf97r+pZzVT49dueQotS/xjjZdcGT0i2Lcou46UFVkWl51ojP1CBSY6QHrODkfLkgglQs8tJZ6B/1/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SV0P279MB0044 X-Mailman-Approved-At: Tue, 24 May 2022 13:29:33 -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:233020 Archived-At: --_000_OL1P279MB0194988AA408911D0B9BB38C88D79OL1P279MB0194NORP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I had another look at it and managed to solve the problem. By default `ispe= ll-dictionary-base-alist' is conservative in setting the regexes for what c= ounts as a word in a given language. I had set `ispell-current-dictionary' = to nil so enchant would choose the dictionary on its own. The nil entry in = the aforementioned alist says a word is a string with the letters A-Z or a-= z and possibly containing '. Changing it to [[:alpha:]] solved the issue. The restrictive regexes are set in `ispell-dictionary-base-alist' but in `i= spell-dictionary-alist' (at least for me) most of the regexes are changed t= o [[:alpha:]]. I'm not sure how that is done but probably there's some good= logic behind it. "british" and "american" (as well as the nil entry) still= have the restrictive regexes, though ... Could we change the nil entry to have the [[:alpha:]] regex? So, if the use= r doesn't explicitly set their dictionary, it works more as expected? --_000_OL1P279MB0194988AA408911D0B9BB38C88D79OL1P279MB0194NORP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I had another look at it and managed to solve the problem. By default `ispe= ll-dictionary-base-alist' is conservative in setting the regexes for what c= ounts as a word in a given language. I had set `ispell-current-dictionary' = to nil so enchant would choose the dictionary on its own. The nil entry in the aforementioned alist says a wo= rd is a string with the letters A-Z or a-z and possibly containing '. Chang= ing it to [[:alpha:]] solved the issue.

The restrictive regexes are set in `ispell-dictionary-base-alist' but in `i= spell-dictionary-alist' (at least for me) most of the regexes are changed t= o [[:alpha:]]. I'm not sure how that is done but probably there's some good= logic behind it. "british" and "american" (as well as the nil entry) still have the restrictive= regexes, though ...

Could we change the nil entry to have the [[:alpha:]] regex? So, if the use= r doesn't explicitly set their dictionary, it works more as expected?
--_000_OL1P279MB0194988AA408911D0B9BB38C88D79OL1P279MB0194NORP_--