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#64215: Python raw format strings highlighted as regular strings Date: Thu, 22 Jun 2023 09:01:08 +0300 Message-ID: <835y7g3ujf.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35790"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64215-done@debbugs.gnu.org To: Joseph Garvin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 22 08:02:26 2023 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 1qCDOk-00097V-7n for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Jun 2023 08:02:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCDOR-000675-0z; Thu, 22 Jun 2023 02:02:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCDON-00066S-5x for bug-gnu-emacs@gnu.org; Thu, 22 Jun 2023 02:02:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCDOM-0006qH-Cc for bug-gnu-emacs@gnu.org; Thu, 22 Jun 2023 02:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qCDOM-0004gu-6c for bug-gnu-emacs@gnu.org; Thu, 22 Jun 2023 02:02:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Jun 2023 06:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 64215 X-GNU-PR-Package: emacs Mail-Followup-To: 64215@debbugs.gnu.org, eliz@gnu.org, joseph.h.garvin@gmail.com Original-Received: via spool by 64215-done@debbugs.gnu.org id=D64215.168741366917882 (code D ref 64215); Thu, 22 Jun 2023 06:02:02 +0000 Original-Received: (at 64215-done) by debbugs.gnu.org; 22 Jun 2023 06:01:09 +0000 Original-Received: from localhost ([127.0.0.1]:34627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCDNV-0004eJ-2E for submit@debbugs.gnu.org; Thu, 22 Jun 2023 02:01:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCDNT-0004dr-Pb for 64215-done@debbugs.gnu.org; Thu, 22 Jun 2023 02:01:08 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCDNO-0006gG-DP; Thu, 22 Jun 2023 02:01:02 -0400 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=l0S91sUsst8dANoYYj9/hxTFsgdQM+F7OQOax/KOIB4=; b=ZXsmGtX1AfnM jUvJ8Xa9hPIFY2BxKTsZ0fp4DBzOa57VxKS244NxFcb0DqiAcYh29t7y7hlj8Q3mDtq2ajRvhfrO0 EVbNxC1Ea0OzwsR6VaOkAiAhoBy5rjpzJ+ViwrtJByni6OCRHc1aU4iQeotPhONs3YgQpN6kudmQd N3+e5lXGhA8HeDUv9Q4TgZ3uGFTw8rWmrv959vWnos6rpFTYf/3ApUs30WTF5RUuwrbUkVgQziFRr kl9wJt3xp7Do+wfHRpVMTr4eULvfFBis7k0Q12RWQFVwB8b6CgBM5HdjRxSwBBiR90w+VND+Wydqc chjfkTriyTNeylXzx6R8/A==; Original-Received: from [87.69.77.57] (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 1qCDNN-0000uZ-EA; Thu, 22 Jun 2023 02:01:01 -0400 In-Reply-To: (message from Joseph Garvin on Wed, 21 Jun 2023 15:07:19 -0500) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263860 Archived-At: > From: Joseph Garvin > 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.