GNU bug report logs - #59720
30.0.50; python-ts-mode: match/case is not fontified properly

Previous Next

Package: emacs;

Reported by: Mickey Petersen <mickey <at> masteringemacs.org>

Date: Wed, 30 Nov 2022 14:07:03 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Mickey Petersen <mickey <at> masteringemacs.org>
Cc: 59720 <at> debbugs.gnu.org
Subject: bug#59720: 30.0.50; python-ts-mode: match/case is not fontified properly
Date: Wed, 30 Nov 2022 16:16:07 +0100
[Message part 1 (text/plain, inline)]
Mickey Petersen <mickey <at> masteringemacs.org> writes:

> 1. Visit a python file. It will use the regular python mode.
> 2. Write:
>
>     def foo():
>          match foo:
>              case 10:
>                  pass
>
> 3. It is highlighted correctly: match and case are fontified with `font-lock-keyword-face'.
> 4. Type M-x python-ts-mode.
> 5. Highlighting is now off for match/case. Text properties for the `m' character are:
>
>     Character code properties: customize what to show
>       name: LATIN SMALL LETTER M
>       general-category: Ll (Letter, Lowercase)
>       decomposition: (109) ('m')
>       uppercase: 77 (M)
>       titlecase: 77 (M)
>
>     There are text properties here:
>       fontified            t
>

The following patch solves the issue by adding "case" and "match" to the
list of keywords that python-ts-mode recognizes.

[0001-Add-case-and-match-to-python-treesit-keywords.patch (text/x-patch, attachment)]

This bug report was last modified 2 years and 229 days ago.

Previous Next


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