From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: kobarity Newsgroups: gmane.emacs.bugs Subject: bug#71093: 30.0.50; python: multiple assignments not fontified Date: Fri, 24 May 2024 22:54:46 +0900 Message-ID: References: <86h6eo4qp2.fsf@gnu.org> <864jan2x95.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Fri_May_24_22:54:46_2024-1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2161"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: andreas.roehler@easy-emacs.de, sunlin7.mail@gmail.com, 71093@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 24 15:57:25 2024 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 1sAVQD-0000KC-4w for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 May 2024 15:57:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAVPp-0007lO-2Z; Fri, 24 May 2024 09:57:01 -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 1sAVPm-0007kq-Tn for bug-gnu-emacs@gnu.org; Fri, 24 May 2024 09:56:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAVPj-0004ff-Fl for bug-gnu-emacs@gnu.org; Fri, 24 May 2024 09:56:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sAVPq-0008RS-CF for bug-gnu-emacs@gnu.org; Fri, 24 May 2024 09:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 May 2024 13:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71093 X-GNU-PR-Package: emacs Original-Received: via spool by 71093-submit@debbugs.gnu.org id=B71093.171655896632175 (code B ref 71093); Fri, 24 May 2024 13:57:02 +0000 Original-Received: (at 71093) by debbugs.gnu.org; 24 May 2024 13:56:06 +0000 Original-Received: from localhost ([127.0.0.1]:37287 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAVOv-0008Mt-P6 for submit@debbugs.gnu.org; Fri, 24 May 2024 09:56:06 -0400 Original-Received: from mail-pf1-f182.google.com ([209.85.210.182]:48205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAVOu-0008MW-Di for 71093@debbugs.gnu.org; Fri, 24 May 2024 09:56:05 -0400 Original-Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6f850ff30c0so1507867b3a.0 for <71093@debbugs.gnu.org>; Fri, 24 May 2024 06:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716558891; x=1717163691; darn=debbugs.gnu.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=+J4LTnzPe25dhAe9yLHpnKveFhAjfgGr7w9IefwRYPw=; b=bP/Ka+x5laRvlvGBxzC3BQWX1l2WKbSg4SuEKpcwCbiGABiCALg1j/pM2GpPJw6xBQ 5AxqP5xDy2aF18q189KF1WdYVAONHc0KTgpK+fnUXVC/ENpM8pUjAd5B1C9rLHM6Khs+ B7vq2gDkpVKwFhLjxICQsS+zbUYxBtvhCEWO4VuBoPGqVBxBwlSnPqPaWClxN6b2Xyab yyGFfSapfaD01GfrddQj/F4OaxMcpmDWgn2vNJT1mQ0cA6TMZBcjE1TgVXesLWkZ29yb PaF2K1L56dfFu2x/Xkp95PCM2OnBliLh++VdGvTRD7ZtROwLl0BAXJrbkrfeeVPcTlXV lJ1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716558891; x=1717163691; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+J4LTnzPe25dhAe9yLHpnKveFhAjfgGr7w9IefwRYPw=; b=TAcUlES04ND6SMF1zZUz0yJGv2cGR3PAX5YOEI9IFTmpEM293Y93LPoQ56zHCzAxrj eh6B8b0nZr2GGLvDBfU6atwZ7zVezwpeD5EFacpM10vwwIEg7BIZvWHPU6wut27GpDCp xbbj5xQM7ipbCXiLhPUffO+xB2QvAeJHhr+ziKiJAJekZdih7LClUyvxGQowwermOUoY jtHbtmVEHVAXpcWwANR1nLN/vitMKsf353bb3B+vQm6tcJ9ttYDbzo5fgPo6wFJDyQX1 Wa3WY91rE6GbrBIcHUgRHkiXSdS5xXVb06fyBt5cftxE5yXvDpgPh95oaeF/kf6jZYvF FM+A== X-Forwarded-Encrypted: i=1; AJvYcCWnDFJztQCCznUIY2x0RGJfsXqTaMTPlUKTlf4hrbaeBHHTtGm1iumBsCCGJV+eiwhDe+VtDtMqXK3hMMQ5T/mqUkfCu54= X-Gm-Message-State: AOJu0YyR1Oh4nhry3eEugTpYsz0tCv0OjH/60dXvmpQ6hxIRTUvVxVKa pERX+mjSQj4VHATWATtr6qvvgZbVOf702yPJN98EWtmpQxpi4LAX X-Google-Smtp-Source: AGHT+IFTys6h3euAxsJ6ItwNaXLjTsJllkoaqc37wey3JGuE6+JEeU2xVu9lWM0FSEr11awuU7Fbiw== X-Received: by 2002:a05:6a20:9716:b0:1ac:8824:156f with SMTP id adf61e73a8af0-1b212d4a413mr2336343637.33.1716558891118; Fri, 24 May 2024 06:54:51 -0700 (PDT) Original-Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f44c9ce8dbsm14015455ad.285.2024.05.24.06.54.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 06:54:50 -0700 (PDT) In-Reply-To: <864jan2x95.fsf@gnu.org> 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:285772 Archived-At: --Multipart_Fri_May_24_22:54:46_2024-1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Eli Zaretskii wrote: > > Date: Fri, 24 May 2024 21:17:39 +0900 > > From: kobarity > > Cc: Andreas R=F6hler , Lin > > Sun , 71093@debbugs.gnu.org > >=20 > > Eli Zaretskii wrote: > > >=20 > > > > Date: Tue, 21 May 2024 12:47:57 +0200 > > > > From: Andreas R=F6hler > > > >=20 > > > > a =3D b =3D c =3D 5 > > > >=20 > > > > b and c are not fontified > > >=20 > > > Can someone please look into fixing this? python-ts-mode does TRT, > > > btw. > >=20 > > Sorry, this bug was introduced by my commit > > 4915ca5dd4245a909c046e6691e8d4a1919890c8. I canceled it in commit > > 6b2c8dc9050c5c0514fa404733ce1d4a37d00e39 due to a performance issue, > > but the cancellation was incomplete. Attached is the patch to fix > > this in master with an ERT. Is it better to fix in emacs-29? >=20 > Thanks. If the regression was in Emacs 29, then yes, it is better to > fix that on the emacs-29 branch. Attached is the patch for emacs-29 branch. --Multipart_Fri_May_24_22:54:46_2024-1 Content-Type: application/octet-stream; type=patch; name="0001-Fix-Python-font-lock-of-chained-assignment-statement.patch" Content-Disposition: attachment; filename="0001-Fix-Python-font-lock-of-chained-assignment-statement.patch" Content-Transfer-Encoding: 7bit >From 1af361a25b2ecd84f6731421eb373b5f28f3b4a1 Mon Sep 17 00:00:00 2001 From: kobarity Date: Fri, 24 May 2024 22:50:12 +0900 Subject: [PATCH] Fix Python font lock of chained assignment statement * lisp/progmodes/python.el (python-font-lock-keywords-maximum-decoration): Allow chaining of single assignment statements. * test/lisp/progmodes/python-tests.el (python-font-lock-assignment-statement-20): New test. (Bug#71093) --- lisp/progmodes/python.el | 3 +-- test/lisp/progmodes/python-tests.el | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 02588d756e9..051f198e192 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -812,8 +812,7 @@ python-font-lock-keywords-maximum-decoration ;; c: Collection = {1, 2, 3} ;; d: Mapping[int, str] = {1: 'bar', 2: 'baz'} (,(python-font-lock-assignment-matcher - (python-rx (or line-start ?\;) (* space) - grouped-assignment-target (* space) + (python-rx grouped-assignment-target (* space) (? ?: (* space) (+ not-simple-operator) (* space)) (group assignment-operator))) (1 font-lock-variable-name-face) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 95db93dd5cc..06943e22f5b 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -474,6 +474,16 @@ python-font-lock-assignment-statement-18 (136 . font-lock-operator-face) (137) (144 . font-lock-keyword-face) (150)))) +(ert-deftest python-font-lock-assignment-statement-20 () + (python-tests-assert-faces + "a = b = c = 1" + '((1 . font-lock-variable-name-face) (2) + (3 . font-lock-operator-face) (4) + (5 . font-lock-variable-name-face) (6) + (7 . font-lock-operator-face) (8) + (9 . font-lock-variable-name-face) (10) + (11 . font-lock-operator-face) (12)))) + (ert-deftest python-font-lock-escape-sequence-string-newline () (python-tests-assert-faces "'\\n' -- 2.34.1 --Multipart_Fri_May_24_22:54:46_2024-1--