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

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Yuan Fu <casouri <at> gmail.com>, Vincenzo Pupillo <v.pupillo <at> gmail.com>,
 77256 <at> debbugs.gnu.org
Subject: Re: bug#77256: Treesit language-at-point
Date: Tue, 08 Apr 2025 21:43:20 +0300
>>>   (if treesit-language-at-point-function
>>>       (funcall treesit-language-at-point-function position)
>
> BTW, can we please avoid this anti-pattern?
> Instead, we should unconditionally call
> `treesit-language-at-point-function` and give a non-nil default value to
> this variable.
>
> This would make sure the `treesit-language-at-point-function` is good
> enough to implement the default behavior and it makes it possible to use
> `add-function` on `treesit-language-at-point-function`.

Unfortunately, it's too late to add a non-nil default value.

I already tried to do the same by adding 'forward-sexp-default-function'
to 'forward-sexp-function', but failed spectacularly (bug#70426),
because there are existing uses that expect the default value to be nil.




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.