GNU bug report logs - #51362
python font-lock-mode in emacs 28 seems broken

Previous Next

Package: emacs;

Reported by: Jeff Spencer <jeffspencerd <at> gmail.com>

Date: Sat, 23 Oct 2021 20:08:02 UTC

Severity: normal

Tags: moreinfo

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>
Cc: Jeff Spencer <jeffspencerd <at> gmail.com>, 51362 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>, Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Subject: bug#51362: python font-lock-mode in emacs 28 seems broken
Date: Thu, 11 Nov 2021 13:37:49 +0100
Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com> writes:

> Would you be able to give it a try?

Or if it's easier in patch form:

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index b12b22e992..eebc9055bf 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -606,10 +606,11 @@ python-font-lock-assignment-matcher
 being treated as assignments) or is followed by an '=' sign (to
 avoid '==' being treated as an assignment."
   (lambda (limit)
-    (let ((res (re-search-forward regexp limit t)))
-      (unless (or (python-syntax-context 'paren)
-                  (equal (char-after (point)) ?=))
-        res))))
+    (let ((res nil))
+      (while (and (setq res (re-search-forward regexp limit t))
+                  (or (python-syntax-context 'paren)
+                      (equal (char-after (point)) ?=))))
+      res)))
 
 (defvar python-font-lock-keywords-maximum-decoration
   `((python--font-lock-f-strings)


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.