GNU bug report logs -
#64215
Python raw format strings highlighted as regular strings
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64215 in the body.
You can then email your comments to 64215 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#64215
; Package
emacs
.
(Thu, 22 Jun 2023 05:48:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Joseph Garvin <joseph.h.garvin <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 22 Jun 2023 05:48:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Thu, 22 Jun 2023 06:02:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Joseph Garvin <joseph.h.garvin <at> gmail.com>
:
bug acknowledged by developer.
(Thu, 22 Jun 2023 06:02:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 64215-done <at> debbugs.gnu.org (full text, mbox):
> From: Joseph Garvin <joseph.h.garvin <at> gmail.com>
> 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.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 20 Jul 2023 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 32 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.