From unknown Fri Jun 20 07:21:39 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#52331 <52331@debbugs.gnu.org> To: bug#52331 <52331@debbugs.gnu.org> Subject: Status: M-$ doesn't respect subword mode Reply-To: bug#52331 <52331@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:21:39 +0000 retitle 52331 M-$ doesn't respect subword mode reassign 52331 emacs submitter 52331 Paul Pogonyshev severity 52331 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 06 10:10:08 2021 Received: (at submit) by debbugs.gnu.org; 6 Dec 2021 15:10:08 +0000 Received: from localhost ([127.0.0.1]:35123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muFd2-0005Y2-BO for submit@debbugs.gnu.org; Mon, 06 Dec 2021 10:10:08 -0500 Received: from lists.gnu.org ([209.51.188.17]:44308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muFd0-0005Xs-Ih for submit@debbugs.gnu.org; Mon, 06 Dec 2021 10:10:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muFcz-0001Oe-N4 for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 10:10:05 -0500 Received: from [2a00:1450:4864:20::52e] (port=34509 helo=mail-ed1-x52e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muFcx-0001Hf-3H for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 10:10:05 -0500 Received: by mail-ed1-x52e.google.com with SMTP id x15so44513091edv.1 for ; Mon, 06 Dec 2021 07:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=sJDpNOoqnIc4kBqNM0AOw4yI6T3aU4iB8FK8Jha7qUI=; b=Flrr9wI3RFnGY9F/ocEbKbBmKaDoWQnBCQbC9hF9eaXN9PuhYUErEz5xydicXWStMJ w1ATh+1J1gzmDi6YriH+bUJxbLNFixwXHKVaVqQ3wYV3IhCOaOb0f4dWy3CUadlYY22U jDrr3njXt9K8k28vN8QQl/51quA1sXOGr632dXPGEkeEEiAw4PWE3hfEnw16I9K9wmKA UR+wXNxi5vNjwX0G78LgQjD4n+8TWUe8TByIF/0XOvdeH/TdrDh2dzvbtyOLagE4AhoJ gbUXKoQ1i7iVctd9yRRP4TebigrYU/c54OgkC8B5wPW/plJJ3BPc6CD59CqDwKId5r6Z Dd7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=sJDpNOoqnIc4kBqNM0AOw4yI6T3aU4iB8FK8Jha7qUI=; b=vUc42i1ETj6ZXPZcWb5fe+a7JlRkw4cvW6bSmkZGHZy6jH9C7W7CVao80+YQFCY2f5 XBZE250XxKHt4fJF+rk14at069MmYkiRHcm365p6bEeQfth9oAwcMJEz/OlP1m6x41/W Otrk8Ox1v0iu5ccUiWzD25bendrvnbC3PyBWIg9sL50gDypqEd8NimS88mJnxA0kIbYr Fu/5a6cZNVA46WMSn1SpqryOzquOeCQ8tabALZQHeYmbB3TYjCtl8bmyoUDM6g38ztPG o3/dIVwoQ2/DjIEdz7ZoWfT/lYqfTkyb8gz+MoHFYhRSMdzg2jtFsIaQ8uzdzHG9luJJ bOSg== X-Gm-Message-State: AOAM530rPnv/o9YycWG/XwAs6hprVAlT072XIV7VM9h8mIPKPBIsWv7Y H3TofDynwtA4CwDYddFxCofBqge7xl6RUGnGJQC/0/5o2A== X-Google-Smtp-Source: ABdhPJy9aaOFqN/GrykNICBISgYF3msYjkut5bGaX6egDiSu4ibDEcHis+CJcHJK8lxl5NfrueDQQxKXebo4SuA8WCo= X-Received: by 2002:aa7:c406:: with SMTP id j6mr56698674edq.76.1638803400739; Mon, 06 Dec 2021 07:10:00 -0800 (PST) MIME-Version: 1.0 From: Paul Pogonyshev Date: Mon, 6 Dec 2021 16:09:49 +0100 Message-ID: Subject: M-$ doesn't respect subword mode To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="0000000000008ecd6805d27ba6d4" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52e (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=pogonyshev@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) BAYES_40=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --0000000000008ecd6805d27ba6d4 Content-Type: text/plain; charset="UTF-8" To reproduce: $ emacs --batch --eval "(global-subword-mode)" --eval "(insert \"getBanana\")" --eval "(ispell-word)" Expected output: ... BANANA is correct Expected output: ... Checking spelling of GETBANANA... C-h or ? for more options; SPC to leave unchanged, Character to replace word Naturally, this also happens in interactive use. Paul --0000000000008ecd6805d27ba6d4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
To reproduce:

$ emacs --batch --eval "= (global-subword-mode)" --eval "(insert \"getBanana\")&q= uot; --eval "(ispell-word)"

Expected output:
...
BANANA is correct<= /span>

Expected output:
...
Checking spelling of = GETBANANA...
C-h or ? for more options; SPC to leave unchanged, Character to replace= word

Naturally, this also happens in interactive use.

Paul<= /div>
--0000000000008ecd6805d27ba6d4-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 06 11:34:52 2021 Received: (at 52331) by debbugs.gnu.org; 6 Dec 2021 16:34:52 +0000 Received: from localhost ([127.0.0.1]:35202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muGx2-0007yd-8m for submit@debbugs.gnu.org; Mon, 06 Dec 2021 11:34:52 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:43869) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muGx0-0007yO-S8 for 52331@debbugs.gnu.org; Mon, 06 Dec 2021 11:34:51 -0500 Received: by mail-wm1-f51.google.com with SMTP id o19-20020a1c7513000000b0033a93202467so264836wmc.2 for <52331@debbugs.gnu.org>; Mon, 06 Dec 2021 08:34:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=TrJsTr2LwC6dPReSJjUetxO/6g9lxLTeXyupAsOMtJw=; b=nzTpD82m8X3N/szf9BCC5l68QlnqEiyYqAnIhJyokjsGfC1TgaF5Wr8FGlxPA3jAiC woTkpbyuK9hnTEY+X21P7eYlyFGXt+3z12gMySr6FcyTLmhS9gyKhEXcVpZlnYt566KW qZRv4LLFyhf2V1bNHLnH2UQwYBOFOmjl/mohYm5BiWp+Zkgw9XV+jntxO7n8+7XKomDM nw1tKM4t9q0Nhlpdjm1/fW6ybhPuEoQZdtQC8HrMgREBUEqyIbpvWzlvdf+/4ZfMpqq2 QkCgHW0u7nh9lcZpg2XxSLTWpShedfzL2mJzB1KHVWax5P/woqUfjWGxsSyXvlMQRo55 Tjig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=TrJsTr2LwC6dPReSJjUetxO/6g9lxLTeXyupAsOMtJw=; b=hZGBfMUeT0kBw0PBpu6Sn+C+7CCZGNohdYSqxmkZKiATLLQdlHhFfpr+LRvsbb+PPX SFHp8wJS3YE8CNuxsBuj6xFirB9xiHY5iUb6jRLxWhg6CTKo70n6obanOMUGO5cJG2Xz Na65dFj52ekD1hqYyGNcrTNIhziVev2w57sPUpXoyGiI1F1cfBp4QwunoK05P3wJTDKD CsNKj0gZQ7ifhMvGnuIqd9tcw2dnXWpmMG0A4NdOv8hVVBJ4OLGRQJWs7ZpswqDJ/BBu qvWUrn7Lobjs0d3nzGnicOM7rKgQOQth2Ekl+KTAP3IY6qf+yuuRs+9xQUxxqlGB2pbW ncfg== X-Gm-Message-State: AOAM532rGG+aEzar7eqxEjbdbfYNZJML3mLTgDDiwrX6tFNZ0WpbTVT5 hIt7HK+fogWQha5GxBJ/UH7AbJBHyt8= X-Google-Smtp-Source: ABdhPJwbbTxXXR8rJBkf+hdoeoQ3hJ10nwb8uF++l6UY9JQnkjHZp0BIMmO49Lkum9tQfTFIf2iEWQ== X-Received: by 2002:a1c:f416:: with SMTP id z22mr40437401wma.121.1638808485225; Mon, 06 Dec 2021 08:34:45 -0800 (PST) Received: from guix-xps13 ([2001:818:daa9:6700:462d:384e:6de8:4a1c]) by smtp.gmail.com with ESMTPSA id j134sm11904948wmj.3.2021.12.06.08.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Dec 2021 08:34:44 -0800 (PST) From: =?utf-8?Q?Andr=C3=A9_A=2E_Gomes?= To: Paul Pogonyshev Subject: Re: bug#52331: M-$ doesn't respect subword mode References: Date: Mon, 06 Dec 2021 16:34:43 +0000 In-Reply-To: (Paul Pogonyshev's message of "Mon, 6 Dec 2021 16:09:49 +0100") Message-ID: <87sfv5y9ng.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 52331 Cc: 52331@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Paul Pogonyshev writes: > To reproduce: > > $ emacs --batch --eval "(global-subword-mode)" --eval "(insert > \"getBanana\")" --eval "(ispell-word)" > > Expected output: > ... > BANANA is correct > > Expected output: > ... > Checking spelling of GETBANANA...=20 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. --=20 Andr=C3=A9 A. Gomes "Free Thought, Free World" From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 06 11:46:33 2021 Received: (at 52331) by debbugs.gnu.org; 6 Dec 2021 16:46:33 +0000 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 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 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==; 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 Date: Mon, 06 Dec 2021 18:46:24 +0200 Message-Id: <83h7bl1y1r.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?Andr=C3=A9?= A. Gomes 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) Subject: Re: bug#52331: M-$ doesn't respect subword mode References: <87sfv5y9ng.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52331 Cc: 52331@debbugs.gnu.org, pogonyshev@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 06 12:21:41 2021 Received: (at 52331) by debbugs.gnu.org; 6 Dec 2021 17:21:41 +0000 Received: from localhost ([127.0.0.1]:35296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muHgK-0000ta-T7 for submit@debbugs.gnu.org; Mon, 06 Dec 2021 12:21:41 -0500 Received: from mail-wr1-f44.google.com ([209.85.221.44]:37836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muHgJ-0000tO-9p for 52331@debbugs.gnu.org; Mon, 06 Dec 2021 12:21:40 -0500 Received: by mail-wr1-f44.google.com with SMTP id d9so23971235wrw.4 for <52331@debbugs.gnu.org>; Mon, 06 Dec 2021 09:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=+6UBTZ37nVd70Yl1W5yk43tEbnQ/MbkRACDlPpk08sQ=; b=E4Bwbjm804hcah22D4Vxn54D9AN3jRDmv4N1aHiWoZ0JThPWuRDNTl1GBoHg+CK+nB zBmyjQqEGI/w0eSkBKwXldAtJjTt3xGrkf0W/u3zyn24Ts3iBByfxjOjtqrP2ekaUyxZ q6lv6XZ7NTfmhVEhCLtyRHzLX0gYT3uYNWF/wPpx708KlsHjKl+hwywz9aVzTLAVyvHB hlggejvyHNJT+EeF5TUuK4fTHaM9oBMvWsNESOITZ+ltxeTvJtRbIoF/hv2WmzRTClKo zAPIRszhyUXrrrdfUCp3a9Q5rbyU5/nOvnjDkdMUHfKbTEnD7F4xtl6pPOehIRv9535+ Zymg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=+6UBTZ37nVd70Yl1W5yk43tEbnQ/MbkRACDlPpk08sQ=; b=atwOttK7wIzQ1DhTitCdYQcPfD50c4NZaJwDcGrI8SKyKLcWCxZCcXHRfjvYC92inR gKXADQZjh/PNvMpJY/9Zg3OQH9AzQi+9Pj3in32Pz87lksPKh+tSGbeSfOXttzXrkQPR ZuMPBydER6d8JbEx26jvMwaWXp+mw9PnlRbmXlZ4DByAbY7rmHyWgynVAJy6cAIZItWp 6JOLrA/7sSVvBizXXs8tpekjyAYQ9rSBfihrIn5rVbXXggXyzrMCCl6gVelr18nGSahu ItpF7lP5mKxDb3i419AR2UajE6j9kYnUIe4XQ/PnANm93RiQXb9hANehnAz0IEm5Qodi cqhw== X-Gm-Message-State: AOAM533zaHl4xiLmKqaRpjDfYU2tAoXCDtWrrjmSpFOrZbAP4ePQbUYF sHPUqUv839UHPX93zrQeNo4wEWLjAQM= X-Google-Smtp-Source: ABdhPJyLSGx5ia7PAUVWptIAPokO8sLOpbFSxWffyoWJlYRgAzEu0hyKEpxSLOw8Yw/v5nQ2BLRU5g== X-Received: by 2002:adf:f207:: with SMTP id p7mr44493734wro.173.1638811293343; Mon, 06 Dec 2021 09:21:33 -0800 (PST) Received: from guix-xps13 ([2001:818:daa9:6700:462d:384e:6de8:4a1c]) by smtp.gmail.com with ESMTPSA id e12sm15174121wrq.20.2021.12.06.09.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Dec 2021 09:21:32 -0800 (PST) From: =?utf-8?Q?Andr=C3=A9_A=2E_Gomes?= To: Eli Zaretskii Subject: Re: bug#52331: M-$ doesn't respect subword mode References: <87sfv5y9ng.fsf@gmail.com> <83h7bl1y1r.fsf@gnu.org> Date: Mon, 06 Dec 2021 17:21:28 +0000 In-Reply-To: <83h7bl1y1r.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 06 Dec 2021 18:46:24 +0200") Message-ID: <87mtldy7hj.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 52331 Cc: 52331@debbugs.gnu.org, pogonyshev@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> 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. 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? > 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? -- Andr=C3=A9 A. Gomes "Free Thought, Free World" From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 06 12:45:45 2021 Received: (at 52331) by debbugs.gnu.org; 6 Dec 2021 17:45:45 +0000 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 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 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==; 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 Date: Mon, 06 Dec 2021 19:45:35 +0200 Message-Id: <83ee6p1vb4.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?Andr=C3=A9?= A. Gomes 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) Subject: Re: bug#52331: M-$ doesn't respect subword mode 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 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52331 Cc: 52331@debbugs.gnu.org, pogonyshev@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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.