all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#41684: [PATCH] Highlight typed variables in python
@ 2020-06-03 11:51 Konstantin Kharlamov
  2020-06-09 23:12 ` Konstantin Kharlamov
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Konstantin Kharlamov @ 2020-06-03 11:51 UTC (permalink / raw)
  To: 41684

* progmodes/python.el (python-font-lock-keywords-maximum-decoration):
recognize typed variables like "foo: int = 1" as well.
---

Hello! This is the patch originally posted here 

https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00033.html

I forgot in Emacs patches has to be sent to bugtracker. So here's the
resend.

 lisp/progmodes/python.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index ae5aff351c0..0263f4cc291 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -634,6 +634,7 @@ python-font-lock-keywords-maximum-decoration
     (,(lambda (limit)
         (let ((re (python-rx (group (+ (any word ?. ?_)))
                              (? ?\[ (+ (not (any  ?\]))) ?\]) (* space)
+                             (? ?: (* space) (+ (any word ?. ?_)) (* space)) ;; a type, like " : int "
                              assignment-operator))
               (res nil))
           (while (and (setq res (re-search-forward re limit t))
-- 
2.26.2






^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-06-13 20:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-03 11:51 bug#41684: [PATCH] Highlight typed variables in python Konstantin Kharlamov
2020-06-09 23:12 ` Konstantin Kharlamov
2020-06-13  7:35 ` Eli Zaretskii
2020-06-13  8:57   ` Konstantin Kharlamov
2020-06-13  9:15     ` Eli Zaretskii
2020-06-13  9:21       ` Konstantin Kharlamov
2020-06-13 10:44     ` Basil L. Contovounesios
2020-06-13 20:01 ` Andrii Kolomoiets
2020-06-13 20:40   ` Konstantin Kharlamov

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.