GNU bug report logs - #77255
Treesit font-lock override for embed ranges

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Tue, 25 Mar 2025 18:30:02 UTC

Severity: normal

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 77255 <at> debbugs.gnu.org, Vincenzo Pupillo <v.pupillo <at> gmail.com>
Subject: bug#77255: Treesit font-lock override for embed ranges
Date: Wed, 02 Apr 2025 09:55:18 +0300
>>> Everything works nicely in the attached example of the liquid major mode
>>> where liquid is the primary parser.  Currently it copies settings
>>> from mhtml-ts-mode.  But later I'll try to inherit from mhtml-ts-mode.
>> 
>> However, with inheritance that causes several changes of the
>> primary parser and several calls to treesit-major-mode-setup
>> during the ts-mode initialization, sometimes I get such backtraces
>> only after the first edit:
>> 
>> Debugger entered--Lisp error: (treesit-node-outdated #<treesit-node-outdated>)
>>  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_78>(beg #<treesit-node-outdated>)
>>  treesit-navigate-thing(35 1 beg html-ts-mode--outline-predicate)
>> 
>> Could you suggest where to look?
>
> Could it be that you passed a lambda/closure to treesit-navigate-thing
> which contains a tree-sitter node?

Thanks, indeed this is because outline-minor-mode was activated
too early on the wrong hook.  It should be activated on the last hook,
i.e. liquid-generic-ts-mode-hook instead of the parent's mhtml-ts-mode-hook.




This bug report was last modified 91 days ago.

Previous Next


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