GNU bug report logs - #77256
Treesit language-at-point

Previous Next

Package: emacs;

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

Date: Tue, 25 Mar 2025 18:44: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


Message #23 received at 77256 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 77256 <at> debbugs.gnu.org, Vincenzo Pupillo <v.pupillo <at> gmail.com>
Subject: Re: bug#77256: Treesit language-at-point
Date: Fri, 04 Apr 2025 19:14:11 +0300
>>> We should also update manual sections that mentions treesit-language-at.
>> 
>> Will do when everything is ok with this patch:
>
> Thanks! LGTM.

Unfortunately, I discovered that it causes treesit-node-outdated errors.

This is because overlays are updated by 'pre-redisplay-functions'
later than outline-minor-mode uses them by 'after-change-functions',
since 'after-change-functions' runs before 'pre-redisplay-functions'.

The reproducible test case: with the latest patch for treesit.el,
and another patch that removes 'mhtml-ts-mode--language-at-point'
from mhtml-ts-mode.el, open a simple html file like this:

<!DOCTYPE html>
<html>
<head>
<title>test</title>
</head>
<body>
</body>
</html>

then type:

1. M-x load-library RET treesit-x RET
2. M-x liquid-generic-ts-mode RET
3. M-x outline-minor-mode RET
4. move point before </html>
5. type SPC

then with non-nil debug-on-error:

Debugger entered--Lisp error: (treesit-node-outdated #<treesit-node-outdated>)
  treesit-node-enclosed-p(#<treesit-node-outdated> #<treesit-node element in 17-82>)
  treesit-navigate-thing(73 1 beg html-ts-mode--outline-predicate)
  treesit-outline-search(#<marker at 82 in test.html>)
  outline-map-region(#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_46> 74 82)
  outline--fix-up-all-buttons(74 82)
  outline--fix-buttons-after-change(74 75 0)
  self-insert-command(1 32)
  funcall-interactively(self-insert-command 1 32)
  command-execute(self-insert-command)




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.