bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Lars Ingebrigtsen
Subject: bug#54131: 29.0.50; Flyspell incorrectly reports first word in Python f-string
Date: Wed, 23 Feb 2022 21:13:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

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?  Or if we want to
just do something hackish, we could make that function check
the face for font-lock-string-face and then limit based on that.  (Which
sounds simple enough.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]