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 18:46:24 +0200 Message-ID: <83h7bl1y1r.fsf@gnu.org> References: <87sfv5y9ng.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="25120"; 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 17:53:38 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 1muHFB-0006Lw-Ul for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Dec 2021 17:53:38 +0100 Original-Received: from localhost ([::1]:49948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muHFB-0001GZ-0r for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Dec 2021 11:53:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muH8p-0003r0-EK for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 11:47:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51914) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muH8p-0008Nk-4Q for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 11:47:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1muH8n-0008LV-Vy for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 11:47: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 16:47: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.163880919332039 (code B ref 52331); Mon, 06 Dec 2021 16:47:01 +0000 Original-Received: (at 52331) by debbugs.gnu.org; 6 Dec 2021 16:46:33 +0000 Original-Received: from localhost ([127.0.0.1]:35227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muH8L-0008Kh-GO for submit@debbugs.gnu.org; Mon, 06 Dec 2021 11:46:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muH8K-0008KQ-5y for 52331@debbugs.gnu.org; Mon, 06 Dec 2021 11:46:32 -0500 Original-Received: from [2001:470:142:3::e] (port=59634 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 1muH8E-0008CO-Rt; Mon, 06 Dec 2021 11:46:26 -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=GzU6ajtzVNdtSojPE9MxH2i735BbSK5lbgxN7zCkSbU=; b=cqoOY3lnvvUbw4kay1Tp r0CYFwPoSQuhx+5MG/iK2qXI2tZ9Gy05KS129vUgRS2F+IXFQNxEB688IL2aAit8Qwrzay0Adi8Lr nMBaCoal/l18CCXM+AvJLJtXW8ep+9bZxrKxXHU9PRXVVqWj3J4aB5+Z9XqxxeDbki29Q8Mn/bZwX Pvapfx0rUzKHq1hY+o2+AhjC+/cMLD05SZqUi0RLrFxjlnqQimneVLBW2EYD3c5bHh0VPmyh97OTM cOMJVSNBkVTnHvzWuWMlNopD/qDxrYyKPxiyZSB5iCxDUpnbDxzZDK6sYeO6V60rJ4u0H4qDPOxh2 JLkbvcAvkKxzzw==; Original-Received: from [87.69.77.57] (port=4214 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 1muH8E-0000VR-LI; Mon, 06 Dec 2021 11:46:26 -0500 In-Reply-To: <87sfv5y9ng.fsf@gmail.com> (message from =?UTF-8?Q?Andr=C3=A9?= A. Gomes on Mon, 06 Dec 2021 16:34:43 +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:221764 Archived-At: > From: André A. Gomes > Date: Mon, 06 Dec 2021 16:34:43 +0000 > Cc: 52331@debbugs.gnu.org > > > $ emacs --batch --eval "(global-subword-mode)" --eval "(insert > > \"getBanana\")" --eval "(ispell-word)" > > > > Expected output: > > ... > > BANANA is correct > > > > Expected output: > > ... > > Checking spelling of GETBANANA... > > Thank you for the bug report. > > There's only one speller checker that handles camelCase (AFAIK), which > is aspell since 0.60.8. If you're using it, then you can add the > following to your init file: > > (setq ispell-extra-args '("--camel-case")) > > However, and the Emacs maintainers will probably agree, the > responsibility of sending the "right" word to the ispell sub-process > should be on Emacs' side. I.e., when subword-mode is on, there should > be a call to word-at-point before sending it to the spell checker. 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. So perhaps a better approach is to teach subword-mode about the word rules of ispell.el, not the other way around. Patches welcome.