GNU bug report logs - #77914
31.0.50; treesit-font-lock-level set to 4 cause rust-ts-mode lost all color

Previous Next

Package: emacs;

Reported by: Eval Exec <execvy <at> gmail.com>

Date: Sat, 19 Apr 2025 05:12:02 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Eval Exec <execvy <at> gmail.com>
Cc: v.pupillo <at> gmail.com, 77914 <at> debbugs.gnu.org
Subject: bug#77914: 31.0.50; treesit-font-lock-level set to 4 cause rust-ts-mode lost all color
Date: Sun, 20 Apr 2025 12:29:07 +0300
> Date: Sun, 20 Apr 2025 15:19:20 +0800
> From: Eval Exec <execvy <at> gmail.com>
> 
> Oh! In the reproduce step, I write a typo, the bug can be reproduced by 
> setting different `treesit-font-lock-level`, wen 
> `treesit-font-lock-level` is 3, all colors are good, when 
> treesit-font-lock-level is 4, all colors are lost.
> To reproduce this: use this rust file:
> 
> Then eval:
> 1. (progn  (setq treesit-font-lock-level 4) (revert-buffer))
> all color are lost.
> 
> 2. (progn  (setq treesit-font-lock-level 3) (revert-buffer))
> colors are good. !Important, level 3 is good, but level 4 lost colors.
> 
> 3. (progn  (setq treesit-font-lock-level 4) (revert-buffer))
> all color are lost again.

Don't use setq, use setopt.  treesit-font-lock-level is a defcustom,
and it has a setter function.




This bug report was last modified 56 days ago.

Previous Next


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