Subject: bug#64215: closed (Re: bug#64215: Python raw format strings highlighted as regular strings)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 22 Jun 2023 06:02:02 +0000

Your bug report

#64215: Python raw format strings highlighted as regular strings

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
64215: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64215
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#64215: Python raw format strings highlighted as regular strings
From: Eli Zaretskii <[email-masked]>
To: Joseph Garvin <[email-masked]>
Cc: [email-masked]
Date: Thu, 22 Jun 2023 09:01:08 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Joseph Garvin <[email-masked]>
> Date: Wed, 21 Jun 2023 15:07:19 -0500
> 
> Start emacs with `emacs -Q`, press C-x C-f and type in a filename that
> ends in .py like "foo.py". Then type in:
> 
> x = 3
> rf"hello {x} world"
> 
> The whole string will be colored as a string literal. r means "raw" which means no escape sequences
> and f means this is a format string where we can interpolate variables like x. Delete the leading 'r' and
> the highlighting will change so that {x} is not highlighted, since it's code. However, raw and format
> strings are not mutually exclusive and it should be considered code in both cases. If you run the
> snippet above in the interpreter you will get "hello 3 world".
> 
> In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll
> bars)
>  of 2021-05-14 built on eruv

Thanks.

You are using a pretest version of Emacs 28.1.  I can reproduce the
problem in Emacs 28, but not in what will soon become Emacs 29.  So I
think we already fixed this problem, and I'm therefore closing this
bug.

Subject: Python raw format strings highlighted as regular strings
From: Joseph Garvin <[email-masked]>
To: [email-masked]
Date: Wed, 21 Jun 2023 15:07:19 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Start emacs with `emacs -Q`, press C-x C-f and type in a filename that
ends in .py like "foo.py". Then type in:

x = 3
rf"hello {x} world"

The whole string will be colored as a string literal. r means "raw" which
means no escape sequences and f means this is a format string where we can
interpolate variables like x. Delete the leading 'r' and the highlighting
will change so that {x} is not highlighted, since it's code. However, raw
and format strings are not mutually exclusive and it should be considered
code in both cases. If you run the snippet above in the interpreter you
will get "hello 3 world".

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.16.0, Xaw3d scroll bars)
 of 2021-05-14 built on eruv
Repository revision: efc24f1e0bb127481bcc9c3054c57c4cd3c99aa9
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.6 LTS