GNU bug report logs - #77906
31.0.50; php-js-mode and js-ts-mode: treesit-show-paren-data--categorize: peculiar error: ("Cannot find the definition of the predicate in `treesit-thing-settings'" list)

Previous Next

Package: emacs;

Reported by: Vincenzo Pupillo <v.pupillo <at> gmail.com>

Date: Fri, 18 Apr 2025 18:58:05 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: Vincenzo Pupillo <v.pupillo <at> gmail.com>, 77906 <at> debbugs.gnu.org
Subject: bug#77906: 31.0.50; php-js-mode and js-ts-mode: treesit-show-paren-data--categorize: peculiar error: ("Cannot find the definition of the predicate in `treesit-thing-settings'" list)
Date: Thu, 24 Apr 2025 09:47:08 +0300
>>  @@ -869,7 +869,7 @@ treesit-parsers-at
>>     (let ((res nil))
>>       ;; Refer to (ref:local-parser-overlay) for more explanation of local
>>       ;; parser overlays.
>>  -    (dolist (ov (overlays-at (or pos (point))))
>>  +    (dolist (ov (overlays-at (1- (or pos (point)))))
>>         (when-let* ((parser (overlay-get ov 'treesit-parser))
>>                     (host-parser (or (null with-host)
>>                                      (overlay-get ov 'treesit-host-parser)))
>> 
>> With this patch the following case works correctly in test.heex:
>> 
>>  <%= if true do %>
>>    <p>hello, tree-sitter!</p>
>>  <% end| %>
>> 
>> With point at "|" the command 'backward-sexp' (C-M-b)
>> correctly jumps to the beginning of "if".
>
> Right.  I think it can be done in backward-sexp since there we know
> we’re moving back.  I assume that’s what you mean.

The problem is that the last time when the arg is still -1
is in 'treesit-forward-sexp', and then it calls
'treesit-beginning-of-thing' with '(abs arg)'.

The complete call chain:

- treesit-forward-sexp
- treesit-beginning-of-thing
- treesit-navigate-thing
- treesit-thing-at
- treesit-node-at
- treesit-parsers-at
- overlays-at

So not clear how to propagate the flag for decrementing the offset.
Maybe by let-binding a new dynamically bound variable?




This bug report was last modified 5 days ago.

Previous Next


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