GNU bug report logs - #78129
[PATCH] 31.0.50; python-ts-mode fontification does not handle normal python constructs

Previous Next

Package: emacs;

Reported by: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>

Date: Tue, 29 Apr 2025 09:42:06 UTC

Severity: normal

Tags: patch

Done: Yuan Fu <casouri <at> gmail.com>

To reply to this bug, email your comments to 78129 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#78129; Package emacs. (Tue, 29 Apr 2025 09:42:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 29 Apr 2025 09:42:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] 31.0.50; python-ts-mode fontification does not handle normal
 python constructs
Date: Tue, 29 Apr 2025 11:40:32 +0200
[Message part 1 (text/plain, inline)]
Hey everyone.

When using python-ts-mode to edit python code, there's quite a few areas where fontification is lacking, but could be provided by the treesitter syntax tree.

* Constants
* Type-names
* variable-names in for-in statements
* import-names in import statements
* variable-declarations in lambda-expressions

Attached is a patch which fixes this.

—
Kind Regards
Jostein Kjønigsen


[Message part 2 (text/html, inline)]
[0001-python-ts-mode-Improve-fontification.patch (application/octet-stream, attachment)]
[Message part 4 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78129; Package emacs. (Tue, 29 Apr 2025 10:54:02 GMT) Full text and rfc822 format available.

Message #8 received at 78129 <at> debbugs.gnu.org (full text, mbox):

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: 78129 <at> debbugs.gnu.org
Subject: Re: bug#78129: Acknowledgement ([PATCH] 31.0.50; python-ts-mode
 fontification does not handle normal python constructs)
Date: Tue, 29 Apr 2025 12:52:37 +0200
[Message part 1 (text/plain, inline)]
The initially submitted patch contains a query which are needlessly complicated (import statements).

Attached is a new patch where this has been simplified.


—
Kind Regards
Jostein Kjønigsen

> On 29 Apr 2025, at 11:42, GNU bug Tracking System <help-debbugs <at> gnu.org> wrote:
> 
> Thank you for filing a new bug report with debbugs.gnu.org.
> 
> This is an automatically generated reply to let you know your message
> has been received.
> 
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
> 
> Your message has been sent to the package maintainer(s):
> bug-gnu-emacs <at> gnu.org
> 
> If you wish to submit further information on this problem, please
> send it to 78129 <at> debbugs.gnu.org.
> 
> Please do not send mail to help-debbugs <at> gnu.org unless you wish
> to report a problem with the Bug-tracking system.
> 
> -- 
> 78129: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78129
> GNU Bug Tracking System
> Contact help-debbugs <at> gnu.org with problems

[Message part 2 (text/html, inline)]
[0001-python-ts-mode-Improve-fontification.patch (application/octet-stream, attachment)]
[Message part 4 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78129; Package emacs. (Wed, 30 Apr 2025 21:27:02 GMT) Full text and rfc822 format available.

Message #11 received at 78129 <at> debbugs.gnu.org (full text, mbox):

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: 78129 <at> debbugs.gnu.org
Cc: Denis Zubarev <dvzubarev <at> yandex.ru>
Subject: Re: bug#78129: Acknowledgement ([PATCH] 31.0.50; python-ts-mode
 fontification does not handle normal python constructs)
Date: Wed, 30 Apr 2025 23:25:43 +0200
[Message part 1 (text/plain, inline)]
And yet a newer patch, which add enum-values being fontified as constants on top of the things discussed below.

Note: This patch removes a "override" rule which used to be in place. I'm writing Python using typing and from I can tell, removing this rule does not have any adverse affects on my code.

Since Denis added that override, I've put him on CC so he can verify if he can confirm my assessment.



—
Kind Regards
Jostein Kjønigsen

> On 29 Apr 2025, at 12:52, Jostein Kjønigsen <jostein <at> secure.kjonigsen.net> wrote:
> 
> The initially submitted patch contains a query which are needlessly complicated (import statements).
> 
> Attached is a new patch where this has been simplified.
> 

> 
> —
> Kind Regards
> Jostein Kjønigsen
> 
>> On 29 Apr 2025, at 11:42, GNU bug Tracking System <help-debbugs <at> gnu.org> wrote:
>> 
>> Thank you for filing a new bug report with debbugs.gnu.org.
>> 
>> This is an automatically generated reply to let you know your message
>> has been received.
>> 
>> Your message is being forwarded to the package maintainers and other
>> interested parties for their attention; they will reply in due course.
>> 
>> Your message has been sent to the package maintainer(s):
>> bug-gnu-emacs <at> gnu.org
>> 
>> If you wish to submit further information on this problem, please
>> send it to 78129 <at> debbugs.gnu.org.
>> 
>> Please do not send mail to help-debbugs <at> gnu.org unless you wish
>> to report a problem with the Bug-tracking system.
>> 
>> -- 
>> 78129: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78129
>> GNU Bug Tracking System
>> Contact help-debbugs <at> gnu.org with problems
> 

[Message part 2 (text/html, inline)]
[0001-python-ts-mode-Improve-fontification.patch (application/octet-stream, attachment)]
[Message part 4 (text/html, inline)]
[0001-python-ts-mode-Improve-fontification.patch (application/octet-stream, attachment)]
[Message part 6 (text/html, inline)]

Reply sent to Yuan Fu <casouri <at> gmail.com>:
You have taken responsibility. (Thu, 01 May 2025 07:55:02 GMT) Full text and rfc822 format available.

Notification sent to Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>:
bug acknowledged by developer. (Thu, 01 May 2025 07:55:03 GMT) Full text and rfc822 format available.

Message #16 received at 78129-done <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
Cc: Denis Zubarev <dvzubarev <at> yandex.ru>, 78129-done <at> debbugs.gnu.org
Subject: Re: bug#78129: Acknowledgement ([PATCH] 31.0.50; python-ts-mode
 fontification does not handle normal python constructs)
Date: Thu, 1 May 2025 00:54:08 -0700

> On Apr 30, 2025, at 2:25 PM, Jostein Kjønigsen <jostein <at> secure.kjonigsen.net> wrote:
> 
> And yet a newer patch, which add enum-values being fontified as constants on top of the things discussed below.
> 
> Note: This patch removes a "override" rule which used to be in place. I'm writing Python using typing and from I can tell, removing this rule does not have any adverse affects on my code.
> 
> Since Denis added that override, I've put him on CC so he can verify if he can confirm my assessment.

Brilliant work! Applied to master. BTW, make sure you reply messages below the quoted original message ;)

Yuan



This bug report was last modified 2 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.