all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Karl Fogel <kfogel@red-bean.com>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <8634qq5f1q.fsf@gnu.org> (raw)
In-Reply-To: <87r0eah5vz.fsf@red-bean.com> (message from Karl Fogel on Thu, 09 May 2024 19:23:12 -0500)

> From: Karl Fogel <kfogel@red-bean.com>
> 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".



      parent reply	other threads:[~2024-05-10  6:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 16:00 `ispell-message' don't spell the subject line if it starts with a square bracket Emanuel Berg
2024-05-09 17:48 ` Eli Zaretskii
2024-05-09 18:05   ` [SOLV3D] " Emanuel Berg
2024-05-10  0:23     ` Karl Fogel
2024-05-10  0:41       ` Emanuel Berg
2024-05-10  1:20       ` Emanuel Berg
2024-05-10  6:58       ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8634qq5f1q.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=kfogel@red-bean.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.