Subject: Re: bug#75198: 31.0.50; [treesitter] peculiar error

From: Yuan Fu <[email-masked]>
Date: Sat, 4 Jan 2025 00:26:08 -0800

> On Dec 30, 2024, at 9:54 AM, Juri Linkov <[email-masked]> wrote:
> 
> close 75198 31.0.50
> thanks
> 
>>> M-x bash-ts-mode
>>> Move cursor
>>> 
>>> peculiar error: ("Cannot find the definition of the predicate in
>>> `treesit-thing-settings'" sexp-list)
>>> 
>>> Emacs becomes pretty much unusable after that.
>> 
>> I rather suspect 1addae07be1982a6cafc0e0b3955b59bd1fb481c "Treesit
>> support for show-paren-mode". At least by commenting out line 3592
>> 
>>  (setq-local show-paren-data-function 'treesit-show-paren-data)
>> 
>> in treesit.el I can work around the problem.
> 
> Sorry, this is fixed now.
> 
> The problem is that 'treesit-parent-until' raises an error by default.
> So needed to copy its implementation where treesit-node-match-p
> sets the argument IGNORE-MISSING to t.
> 
> Or maybe better to add new arg IGNORE-MISSING to treesit-parent-until.

Hmm, I’m not sure. If we go this route, we’d need to add IGNORE-MISSING for every single function that uses treesit-node-match-p. It’s better for these functions to check whether the definition of the thing they’re going to use exists or not, before calling treesit-node-match-p; alternatively, if they know they don’t care, they can pass t to IGNORE-MISSING.

Yuan