GNU bug report logs - #67703
Fix python-ts-mode syntax higlighting as to account for default arguments

Previous Next

Package: emacs;

Reported by: Maciej Kalandyk <m.kalandyk <at> outlook.com>

Date: Fri, 8 Dec 2023 04:43:01 UTC

Severity: normal

Tags: patch

Fixed in version 29.2

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 67703 in the body.
You can then email your comments to 67703 AT debbugs.gnu.org in the normal way.

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#67703; Package emacs. (Fri, 08 Dec 2023 04:43:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maciej Kalandyk <m.kalandyk <at> outlook.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 08 Dec 2023 04:43:02 GMT) Full text and rfc822 format available.

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

From: Maciej Kalandyk <m.kalandyk <at> outlook.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Fix python-ts-mode syntax higlighting as to account for default
 arguments
Date: Fri, 08 Dec 2023 05:36:52 +0100
[Message part 1 (text/plain, inline)]
Tags: patch


Patch fixes lack of syntax highlighting for default arguments using
python-ts-mode

In GNU Emacs 29.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.37, cairo version 1.16.0)
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Guix System

Configured using:
 'configure
 CONFIG_SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash
 SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash
 --prefix=/gnu/store/475y8j60g7ixylvfh3viwnfl6i5j4fcj-emacs-next-tree-sitter-29.0.91
 --enable-fast-install --with-modules --with-cairo
 --with-native-compilation --disable-build-details'

[patch.patch (text/patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67703; Package emacs. (Fri, 08 Dec 2023 06:52:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Maciej Kalandyk <m.kalandyk <at> outlook.com>
Cc: 67703 <at> debbugs.gnu.org
Subject: Re: bug#67703: Fix python-ts-mode syntax higlighting as to account for
 default arguments
Date: Fri, 08 Dec 2023 08:51:32 +0200
> From: Maciej Kalandyk <m.kalandyk <at> outlook.com>
> Date: Fri, 08 Dec 2023 05:36:52 +0100
> 
> Patch fixes lack of syntax highlighting for default arguments using
> python-ts-mode

Thanks, but could you please show a snippet of Python code where the
problem and the fix are visible?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67703; Package emacs. (Sun, 10 Dec 2023 06:21:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Maciej Kalandyk <m.kalandyk <at> outlook.com>
Cc: 67703 <at> debbugs.gnu.org
Subject: Re: bug#67703: Fix python-ts-mode syntax higlighting as to account
 for default arguments
Date: Sun, 10 Dec 2023 08:19:29 +0200
[Please use Reply All to keep the bug tracker on the CC list.]

Forwarding to the bug tracker:

> From: Maciej Kalandyk <m.kalandyk <at> outlook.com>
> Date: Sun, 10 Dec 2023 00:57:15 +0000
> msip_labels:
> 
> in this code without patch
> 
> def test(x=None):
>       return x
> 
> x=None in function signature won't be highlighted as definition




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67703; Package emacs. (Sun, 10 Dec 2023 10:16:01 GMT) Full text and rfc822 format available.

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

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Maciej Kalandyk <m.kalandyk <at> outlook.com>
Cc: 67703 <at> debbugs.gnu.org
Subject: Re: bug#67703: Fix python-ts-mode syntax higlighting as to account
 for default arguments
Date: Sun, 10 Dec 2023 02:15:36 -0800

On 12/9/23 10:19 PM, Eli Zaretskii wrote:
> [Please use Reply All to keep the bug tracker on the CC list.]
>
> Forwarding to the bug tracker:
>
>> From: Maciej Kalandyk <m.kalandyk <at> outlook.com>
>> Date: Sun, 10 Dec 2023 00:57:15 +0000
>> msip_labels:
>>
>> in this code without patch
>>
>> def test(x=None):
>>       return x
>>
>> x=None in function signature won't be highlighted as definition
Ok, the fix makes sense. Basically, in such a function:


"a" is fontified but "b" isn't, the patch will fontify "b".

One thing though, the patch contains some indentation changes to 
unrelated code.

Yuan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67703; Package emacs. (Sun, 10 Dec 2023 16:36:02 GMT) Full text and rfc822 format available.

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

From: Maciej Kalandyk <m.kalandyk <at> outlook.com>
To: "67703 <at> debbugs.gnu.org" <67703 <at> debbugs.gnu.org>
Subject: Re: bug#67703: Fix python-ts-mode syntax higlighting as to account
 for  default arguments
Date: Sun, 10 Dec 2023 16:35:22 +0000
[Message part 1 (text/plain, inline)]
Sorry for that, i am quite new to git.
Attaching patch with only important parts
[Message part 2 (text/html, inline)]
[patch.patch (text/x-patch, attachment)]

Reply sent to Dmitry Gutov <dmitry <at> gutov.dev>:
You have taken responsibility. (Sun, 10 Dec 2023 23:18:02 GMT) Full text and rfc822 format available.

Notification sent to Maciej Kalandyk <m.kalandyk <at> outlook.com>:
bug acknowledged by developer. (Sun, 10 Dec 2023 23:18:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Maciej Kalandyk <m.kalandyk <at> outlook.com>, 67703-done <at> debbugs.gnu.org
Subject: Re: bug#67703: Fix python-ts-mode syntax higlighting as to account
 for default arguments
Date: Mon, 11 Dec 2023 01:16:59 +0200
Version: 29.2

On 10/12/2023 18:35, Maciej Kalandyk wrote:
> Sorry for that, i am quite new to git.
> Attaching patch with only important parts
> 
> patch.patch
> 
> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> index 4b940b3..b625948 100644
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -1121,7 +1121,8 @@ fontified."
>         name: (identifier) @font-lock-function-name-face)
>        (class_definition
>         name: (identifier) @font-lock-type-face)
> -     (parameters (identifier) @font-lock-variable-name-face))
> +     (parameters (identifier) @font-lock-variable-name-face)
> +     (parameters (default_parameter name: (identifier) @font-lock-variable-name-face)))
>   
>      :feature 'function
>      :language 'python

Thanks! Installed.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 08 Jan 2024 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 163 days ago.

Previous Next


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