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#52331: M-$ doesn't respect subword mode Date: Mon, 06 Dec 2021 19:45:35 +0200 Message-ID: <83ee6p1vb4.fsf@gnu.org> References: <87sfv5y9ng.fsf@gmail.com> <83h7bl1y1r.fsf@gnu.org> <87mtldy7hj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27788"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52331@debbugs.gnu.org, pogonyshev@gmail.com To: =?UTF-8?Q?Andr=C3=A9?= A. Gomes Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 06 18:46:21 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 1muI4D-0006y4-Gg for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Dec 2021 18:46:21 +0100 Original-Received: from localhost ([::1]:59602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muI4B-0004TY-ER for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Dec 2021 12:46:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muI3t-0004TL-U5 for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 12:46:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52040) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muI3t-00015D-Lw for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 12:46:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1muI3t-0001b9-JG for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 12:46: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: Mon, 06 Dec 2021 17:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52331 X-GNU-PR-Package: emacs Original-Received: via spool by 52331-submit@debbugs.gnu.org id=B52331.16388127456105 (code B ref 52331); Mon, 06 Dec 2021 17:46:01 +0000 Original-Received: (at 52331) by debbugs.gnu.org; 6 Dec 2021 17:45:45 +0000 Original-Received: from localhost ([127.0.0.1]:35353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muI3c-0001aO-Ni for submit@debbugs.gnu.org; Mon, 06 Dec 2021 12:45:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muI3b-0001aB-1k for 52331@debbugs.gnu.org; Mon, 06 Dec 2021 12:45:43 -0500 Original-Received: from [2001:470:142:3::e] (port=34044 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muI3V-000102-PY; Mon, 06 Dec 2021 12:45:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=soXYDXD+GAlwpC0o96hgvGyMCyO0VnQRCeiWloASUE0=; b=FKdZSV1pk++ImZLQx/rk 1NMKFHkHk00tyWd6pBNauqaCblXTih4+G2oqXOLUst+TA550qpFfROleTfSZpIMHO4jNrpL6pzTpL KroMufgFSbsBdSDzklsUy/Zm6lxq8swtzGfKLrEPFfnwLueGZ2BaLkwv7+3XLlvJBm0hPa0FSegSY z8P9upWFvpmxUae+a1yaCgEr+xyA7ldR69CMWJXlWYi67CosvxkLVH/LQlOodf/7nzcRk/i7XoPfs rq6RSx61C52yMGg75ofqKSHXNeTSg/f5TahyYyBmIFVe7srwnzN3NbLHyW6aDxNd8nETQ3GW9b/Qi 3cMaaCG+iPfklQ==; Original-Received: from [87.69.77.57] (port=3920 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muI3V-00025S-IG; Mon, 06 Dec 2021 12:45:37 -0500 In-Reply-To: <87mtldy7hj.fsf@gmail.com> (message from =?UTF-8?Q?Andr=C3=A9?= A. Gomes on Mon, 06 Dec 2021 17:21:28 +0000) 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:221773 Archived-At: > From: André A. Gomes > Cc: pogonyshev@gmail.com, 52331@debbugs.gnu.org > Date: Mon, 06 Dec 2021 17:21:28 +0000 > > > It's not that easy, unfortunately. ispell.el has its own rules for > > what is a word, and the rules aren't static, they are determined > > dynamically by the definition of the dictionary. That's because of at > > least 2 reasons: (1) the rules must match what the dictionary > > considers a word, and (2) spell-checking is expected to work in > > buffers that mix several languages, so the rules need to be sensitive > > to the language of the dictionary and reject "words" whose letters are > > not part of the language. > > Correct, my comment was over simplistic. But I don't see where my > reasoning fails. I can't think of an example where calling > word-at-point before the ispell rules kick in would make harm. What am > I missing? See ispell-get-word, I think it will explain what I meant. This is what ispell.el is using to determine what is a "word". > > So perhaps a better approach is to teach subword-mode about the word > > rules of ispell.el, not the other way around. Patches welcome. > > I don't see how this could help. Care to expand a bit? subword-mode uses regular expressions to find where the word begins and ends. Either use different regexps (derived from what ispell.el uses) when spell-checking, or make ispell.el define its own subword-forward/backward-functions for subword-mode to use instead of its defaults.