unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Dario Gjorgjevski <dario.gjorgjevski@gmail.com>
Cc: "Jeff Spencer" <jeffspencerd@gmail.com>,
	51362@debbugs.gnu.org, "Stefan Kangas" <stefan@marxist.se>,
	"Kévin Le Gouguec" <kevin.legouguec@gmail.com>
Subject: bug#51362: python font-lock-mode in emacs 28 seems broken
Date: Thu, 11 Nov 2021 13:37:49 +0100	[thread overview]
Message-ID: <87a6ia6f6q.fsf@gnus.org> (raw)
In-Reply-To: <CAJm4QYPhW9oeZ6sttc5PEu=RBHChj5CFrq1B_AVmGHMMxEmcQA@mail.gmail.com> (Dario Gjorgjevski's message of "Thu, 11 Nov 2021 09:04:01 +0100")

Dario Gjorgjevski <dario.gjorgjevski@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





  parent reply	other threads:[~2021-11-11 12:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-23 20:06 bug#51362: python font-lock-mode in emacs 28 seems broken Jeff Spencer
2021-10-24 12:45 ` Stefan Kangas
2021-10-24 22:37   ` Jeff Spencer
2021-10-24 22:40     ` Jeff Spencer
2021-10-31  9:34   ` Kévin Le Gouguec
2021-11-11  8:04     ` Dario Gjorgjevski
2021-11-11  8:48       ` Stefan Kangas
2021-11-11 12:37       ` Lars Ingebrigtsen [this message]
2022-04-17 23:32 ` kobarity
2022-04-18  9:50   ` Lars Ingebrigtsen
2022-04-18 12:34     ` kobarity
2022-04-18 12:36       ` Lars Ingebrigtsen
2022-05-16 13:40         ` Lars Ingebrigtsen
2022-05-16 14:21           ` kobarity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6ia6f6q.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=51362@debbugs.gnu.org \
    --cc=dario.gjorgjevski@gmail.com \
    --cc=jeffspencerd@gmail.com \
    --cc=kevin.legouguec@gmail.com \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).