From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#41684: [PATCH] Highlight typed variables in python Date: Wed, 3 Jun 2020 14:51:03 +0300 Message-ID: <20200603115103.69611-1-Hi-Angel@yandex.ru> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="44537"; mail-complaints-to="usenet@ciao.gmane.io" To: 41684@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 03 13:52:24 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgRwS-000BPJ-SS for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Jun 2020 13:52:20 +0200 Original-Received: from localhost ([::1]:54744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgRwR-00019y-U0 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Jun 2020 07:52:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgRwC-000135-L7 for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 07:52:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58937) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgRwA-00042k-Am for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 07:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jgRwA-0001DI-80 for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 07:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Jun 2020 11:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41684 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15911850844615 (code B ref -1); Wed, 03 Jun 2020 11:52:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Jun 2020 11:51:24 +0000 Original-Received: from localhost ([127.0.0.1]:42250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgRvX-0001CM-Tl for submit@debbugs.gnu.org; Wed, 03 Jun 2020 07:51:24 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:55730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jgRvV-0001CF-UN for submit@debbugs.gnu.org; Wed, 03 Jun 2020 07:51:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgRvV-0000Yq-M3 for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 07:51:21 -0400 Original-Received: from forward102j.mail.yandex.net ([5.45.198.243]:34510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgRvS-0003x1-Ga for bug-gnu-emacs@gnu.org; Wed, 03 Jun 2020 07:51:20 -0400 Original-Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 37073F20A9B for ; Wed, 3 Jun 2020 14:51:13 +0300 (MSK) Original-Received: from myt5-ca5ec8faf378.qloud-c.yandex.net (myt5-ca5ec8faf378.qloud-c.yandex.net [2a02:6b8:c12:2514:0:640:ca5e:c8fa]) by mxback7o.mail.yandex.net (mxback/Yandex) with ESMTP id q23QsvqGTJ-pDlSiKAp; Wed, 03 Jun 2020 14:51:13 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1591185073; bh=fE/SKBktFlE4bhUWFJV7zpV0P6jfT1g4/w5o/Ftgn34=; h=Subject:To:From:Date:Message-Id; b=SZesiqnZULHo1inxV/dPOrpoHPFlQHzSwQk8dmYoBhVipBwxlrpfJXnCw+tDcIQne bLy8lyaXjUdUooSFejZCYwbXp0zktndvd/+S5L6yUm7dU/nMl5g52OCY1xVaEliMAM z2mqMP5tbBmHpqAnTugqrXySbbGZRQvdsicMQlGU= Authentication-Results: mxback7o.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by myt5-ca5ec8faf378.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id uN7XNBpTgN-pC2eTcKr; Wed, 03 Jun 2020 14:51:12 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) X-Mailer: git-send-email 2.26.2 Received-SPF: pass client-ip=5.45.198.243; envelope-from=Hi-Angel@yandex.ru; helo=forward102j.mail.yandex.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/03 07:51:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181453 Archived-At: * 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