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 #85 received at 77256 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 77256 <at> debbugs.gnu.org, Vincenzo Pupillo <v.pupillo <at> gmail.com>,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#77256: Treesit language-at-point
Date: Thu, 17 Apr 2025 11:01:41 -0400
> Ultimately I think you are right that we want guarantee to Lisp programs
> that parser ranges are always up-to-date, so they don’t have to call
> treesit-update-ranges themselves every where. But the exact implementation
> to achieve that is still not super clear in my head. After thinking about
> this more and rewriting this reply three times, I think the best way might
> be to call treesit--pre-redisplay in
> after-change-functions. Treesit--pre-redisplay should make sure all the
> parser ranges are updated. The only thing I don’t like about this is that
> there’re many cases where a series of buffer edits are made, and we don’t
> want to update ranges after each single buffer edit. Post-command-hook
> should prevent that, but post-command-hook feels really user-facing and
> high-level to me.

I don't know how ranges are managed/computed, but the usual way to
handle this kind of problem is to separate the "mark as out of date"
from the actual update which you do only lazily when a request
is made.


        Stefan





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.