unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: larsi@gnus.org, 54131@debbugs.gnu.org
Subject: bug#54131: 29.0.50; Flyspell incorrectly reports first word in Python f-string
Date: Thu, 24 Feb 2022 08:33:24 +0200	[thread overview]
Message-ID: <83mtigsrij.fsf@gnu.org> (raw)
In-Reply-To: <CAArVCkQ_ZJO53tLg8xetjD1QcB5gpSDTksS8MLP+SmQmQ2kAeg@mail.gmail.com> (message from Philipp Stephani on Wed, 23 Feb 2022 21:27:04 +0100)

> Resent-From: Philipp Stephani <p.stephani2@gmail.com>
> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
> Resent-CC: bug-gnu-emacs@gnu.org
> Resent-Sender: help-debbugs@gnu.org
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Wed, 23 Feb 2022 21:27:04 +0100
> Cc: 54131@debbugs.gnu.org
> 
> Am Mi., 23. Feb. 2022 um 21:13 Uhr schrieb Lars Ingebrigtsen <larsi@gnus.org>:
> >
> > Philipp Stephani <p.stephani2@gmail.com> writes:
> >
> > > Given this Python file:
> > >
> > > $ cat /tmp/a.py
> > > print(f'hello world')
> > >
> > > Visit it and enable Flyspell:
> > >
> > > $ emacs -Q /tmp/a.py -f flyspell-prog-mode
> > >
> > > Flyspell then marks the string "f'hello" as incorrect, thinking it's a
> > > misspelling of "hello".  But it shouldn't cross the string boundary.
> >
> > Hm, yes.  In this case, the mode knows that f isn't part of the
> > expression, but I guess we have no way of communicating that to ispell?
> >
> > Skimming ispell-get-word, it looks like it uses a regexp to determine
> > what the word at point is, so we'd need to make some sort of framework
> > to allow modes to say where a string begins and ends?
> 
> Like the syntax table? (nth 8 (syntax-ppss)) gives you the beginning
> of the string, and that seems to give correct results even for
> f-strings.

That's not how flyspell-prog-mode works, see my other message.  I
guess it doesn't want to run syntax analysis functions on the fly, as
that could be too slow (flyspell being on post-command-hook), but
instead relies on font lock that is run by the display engine anyway.





  reply	other threads:[~2022-02-24  6:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 18:16 bug#54131: 29.0.50; Flyspell incorrectly reports first word in Python f-string Philipp Stephani
2022-02-23 20:13 ` Lars Ingebrigtsen
2022-02-23 20:27   ` Philipp Stephani
2022-02-24  6:33     ` Eli Zaretskii [this message]
2022-02-24  6:27   ` Eli Zaretskii
2022-02-24  9:12     ` Lars Ingebrigtsen
2022-02-24  9:26       ` martin rudalics
2022-02-24 10:19       ` Eli Zaretskii
2022-02-24 11:23         ` Visuwesh
2022-02-24 14:36           ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83mtigsrij.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=54131@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=p.stephani2@gmail.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).