emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41684: closed ([PATCH] Highlight typed variables in python)


From: GNU bug Tracking System
Subject: bug#41684: closed ([PATCH] Highlight typed variables in python)
Date: Sat, 13 Jun 2020 07:36:01 +0000

Your message dated Sat, 13 Jun 2020 10:35:34 +0300
with message-id <83ftaz4dvd.fsf@gnu.org>
and subject line Re: bug#41684: [PATCH] Highlight typed variables in python
has caused the debbugs.gnu.org bug report #41684,
regarding [PATCH] Highlight typed variables in python
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
41684: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=41684
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] Highlight typed variables in python Date: Wed, 3 Jun 2020 14:51:03 +0300
* 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




--- End Message ---
--- Begin Message --- Subject: Re: bug#41684: [PATCH] Highlight typed variables in python Date: Sat, 13 Jun 2020 10:35:34 +0300
> From: Konstantin Kharlamov <Hi-Angel@yandex.ru>
> Date: Wed,  3 Jun 2020 14:51:03 +0300
> 
> * progmodes/python.el (python-font-lock-keywords-maximum-decoration):
> recognize typed variables like "foo: int = 1" as well.
> ---

Thanks, I installed this on the master branch.

For the future, please note a couple of minor stylistic nits:

  . it is better to submit patches in "git format-patch" format, as
    that makes it easier to apply the patch
  . the description in the log message should start with a capital
    letter after the function's name
  . if a comment or a code line exceeds 80 columns, break them into
    several lines


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]