Subject: Re: bug#54131: 29.0.50; Flyspell incorrectly reports first word in Python f-string

From: Eli Zaretskii <[email-masked]>
Date: Thu, 24 Feb 2022 12:19:59 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Thu, 24 Feb 2022 10:12:58 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > For program sources, flyspell-prog-mode relies on font-lock faces to
> > tell it where strings and comments are, so perhaps this part doesn't
> > work for some reason (and perhaps the root cause is in font-lock of
> > python-mode, not in flyspell.el per se).
> 
> I didn't know about flyspell-prog-mode, but it does indeed do the right
> thing here.  (I've now mentioned the mode in the flyspell-mode doc
> string.)

That's strange, because the OP explicitly invoked flyspell-prog-mode,
so how come it didn't work for Philipp, but did for you?

> But `M-$' does not do the right thing -- if you `M-$' on f'hello, it
> tries to correct the whole thing.

Maybe we should have a key binding for
ispell-comment-or-string-at-point, and/or maybe
ispell-comments-and-strings and flyspell-prog-mode should rebind M-$
to ispell-comment-or-string-at-point.