all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Konstantin Kharlamov <Hi-Angel@yandex.ru>
To: 41684@debbugs.gnu.org
Subject: bug#41684: [PATCH] Highlight typed variables in python
Date: Wed,  3 Jun 2020 14:51:03 +0300	[thread overview]
Message-ID: <20200603115103.69611-1-Hi-Angel@yandex.ru> (raw)

* 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






             reply	other threads:[~2020-06-03 11:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 11:51 Konstantin Kharlamov [this message]
2020-06-09 23:12 ` bug#41684: [PATCH] Highlight typed variables in python 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

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

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

  git send-email \
    --in-reply-to=20200603115103.69611-1-Hi-Angel@yandex.ru \
    --to=hi-angel@yandex.ru \
    --cc=41684@debbugs.gnu.org \
    /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 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.