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.devel Subject: Re: [SOLV3D] Re: `ispell-message' don't spell the subject line if it starts with a square bracket Date: Fri, 10 May 2024 09:58:25 +0300 Message-ID: <8634qq5f1q.fsf@gnu.org> References: <87o79fm0ue.fsf@dataswamp.org> <86jzk26fml.fsf@gnu.org> <877cg2n9mq.fsf_-_@dataswamp.org> <87r0eah5vz.fsf@red-bean.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25799"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Karl Fogel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 10 08:59:07 2024 Return-path: Envelope-to: ged-emacs-devel@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 1s5KDh-0006QE-K8 for ged-emacs-devel@m.gmane-mx.org; Fri, 10 May 2024 08:59:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5KDB-0002lg-2P; Fri, 10 May 2024 02:58:33 -0400 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 1s5KD8-0002lX-52 for emacs-devel@gnu.org; Fri, 10 May 2024 02:58:30 -0400 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 1s5KD7-0006vm-Gc; Fri, 10 May 2024 02:58:29 -0400 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=6o6kC/8QT2saxh9GFvFr5Q6jiLHVT1/4aWMEqbq1eo8=; b=DSUQnfAksmRm oZC58dIk3HQWJ7FN3gd/tvGLGwa6NUcuVX1+yR1ZzH/VSeOy9xezLKszDhHuuczx1Sxdyoi7cA+bX /hwC7iMdUIPzw3FvLokTr6dqGTQ6Kc0BJf7kqKy3bQQ0rUFiQ2znumh7qwrBBn901rSqIbVADqxzD j5SZ029AWB0yW32wIDgbPFpuvOqzWBdUX8S6VBos+ev4kzuL+Nt8I7M2pSNvNVgDgr9+aPOBx2Pap qvSLb+TNZJjrtJBOy2QBJSHpcuFo+53G3hqfIhsZKi35QjUFHfPTiQ7swyr/hGXuXgDv/n5lNcQrF LXu5kw7Dp6nlaetv5IeOnw==; In-Reply-To: <87r0eah5vz.fsf@red-bean.com> (message from Karl Fogel on Thu, 09 May 2024 19:23:12 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319112 Archived-At: > From: Karl Fogel > Date: Thu, 09 May 2024 19:23:12 -0500 > > On 09 May 2024, Emanuel Berg wrote: > >Eli Zaretskii wrote: > > > >> No, it's a feature [...] it doesn't spell-check Subject if > >> it comes from another message: if it starts with "Re:" > >> (which indicates the Subject comes from the message to which > >> you reply), or if it starts with "[", which indicates > >> a forwarded message > > > >I think "Fwd:" is the convention for forwarded messages, but > >you are right, people add such little notes sometimes, like > >[SOLVED], [OFF LIST] and so on and then most often the subject > >line shouldn't be spell-checked except for within the square > >brackets maybe :) > > Yes: I've seen "Fwd:" used, and also "[FWD]". > > But there are other little things that people put in square > brackets that probably *shouldn't* block spell-check. For > example, "[PATCH]" and "[PROPOSAL]". > > I haven't tested the attached patch, but if there is consensus on > this general direction of fix, I would be happy to finalize it > (updating it based on suggestions here) and test it. I agree to the general direction, but the actual implementation you propose is IMO wrong. Try forwarding a message from Rmail or Gnus with the default settings, and you will see that "[" is not followed by any telltale string; the very fact that the subject is in "[...]" _is_ the only indication of the fact that the message is being forwarded. So removing the "\\[" match is not TRT here. AFAICT, MH-E uses yet another format for forwarded messages. And I don't know what other Emacs-based MUAs do with subject of forwarded and replied messages. OTOH, just having the "Fwd: " prefix doesn't avoid spell-checking the Subject, which is a bug of an opposite kind (false negative). So I think we should leave the "\\[" pattern alone, and instead override the no-spell-checking decision if only part of the subject is in brackets. If we also want not to spell-check the part inside the brackets, we could instead skip the bracketed part. (If the entire Subject is bracketed, as in the default-formatted forwarded messages, that would avoid spell-checking all of it.) Not sure how important that is, since the text inside the brackets is usually auto-generated and thus correct (see the examples you posted). There's a more general issue here: ispell-message currently doesn't know about all the localized variants of "Re:" and "Fwd:", although the MUAs generally do: see, for example, rmail-re-abbrevs. So bonus points for detecting replied and forwarded Subject lines using these patterns. P.S. It's too bad this discussion is here and not on the bug tracker. Bugs, even potential bugs, should _always_ be reported using "M-x report-emacs-bug".