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.bugs Subject: bug#54131: 29.0.50; Flyspell incorrectly reports first word in Python f-string Date: Thu, 24 Feb 2022 08:33:24 +0200 Message-ID: <83mtigsrij.fsf@gnu.org> References: <877d9l5ok8.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7608"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 54131@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 24 07:34:25 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1nN7hp-0001oJ-F4 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Feb 2022 07:34:25 +0100 Original-Received: from localhost ([::1]:48036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nN7ho-0001nK-D6 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Feb 2022 01:34:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nN7hS-0001nC-QR for bug-gnu-emacs@gnu.org; Thu, 24 Feb 2022 01:34:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nN7hS-0004eB-H6 for bug-gnu-emacs@gnu.org; Thu, 24 Feb 2022 01:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nN7hS-0003BO-E3 for bug-gnu-emacs@gnu.org; Thu, 24 Feb 2022 01:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Feb 2022 06:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54131 X-GNU-PR-Package: emacs Original-Received: via spool by 54131-submit@debbugs.gnu.org id=B54131.164568440112185 (code B ref 54131); Thu, 24 Feb 2022 06:34:02 +0000 Original-Received: (at 54131) by debbugs.gnu.org; 24 Feb 2022 06:33:21 +0000 Original-Received: from localhost ([127.0.0.1]:47316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nN7gn-0003AS-1O for submit@debbugs.gnu.org; Thu, 24 Feb 2022 01:33:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nN7gl-0003AC-8X for 54131@debbugs.gnu.org; Thu, 24 Feb 2022 01:33:19 -0500 Original-Received: from [2001:470:142:3::e] (port=35498 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nN7gf-0004b5-Us; Thu, 24 Feb 2022 01:33:13 -0500 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=6e5K+tLEIBaJ4Dd56tBCGFeqZ9BlgF5YBJkPtbDHwh8=; b=f7NlblMwU0N/ pb7SwUnNjkMylUdXXE5QjkeJFo3UirQSpsf4CRHXr8KPpOaaTsnRLICg4plJ+BJrgryp3yMK+PnDp CwgYZCkbVjecoTc9qF9SabmOkec+jen/Bslo6pWg5WUexRwEF2wCj9Ewyr8lMfORKe9YR7cOge+oI hEpbCP04UF5yUPXDZ+vMtjLgAi4drH/2e6r+hv6iHH2F3nuN8wzEOJjM1wpJOoB7K1+zlBkiiNFBW BMhA+awGzegsZ3U7lFtEccWV01OhO8J2sBXgIMFp3y3YmVec9GJoYjkaGsQHlZyDL3BbXGPtiwdiB xE9YbyRLDcCCpUsnF4Zykw==; Original-Received: from [87.69.77.57] (port=1658 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nN7ge-00055n-Mh; Thu, 24 Feb 2022 01:33:13 -0500 In-Reply-To: (message from Philipp Stephani on Wed, 23 Feb 2022 21:27:04 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:227560 Archived-At: > Resent-From: Philipp Stephani > Original-Sender: "Debbugs-submit" > Resent-CC: bug-gnu-emacs@gnu.org > Resent-Sender: help-debbugs@gnu.org > From: Philipp Stephani > 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 : > > > > Philipp Stephani 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.