GNU bug report logs -
#77870
treesit-language-at-point-default signals error (as of 4c5c20d)
Previous Next
Reported by: Ship Mints <shipmints <at> gmail.com>
Date: Thu, 17 Apr 2025 15:53:01 UTC
Severity: normal
Done: Yuan Fu <casouri <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77870 in the body.
You can then email your comments to 77870 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77870
; Package
emacs
.
(Thu, 17 Apr 2025 15:53:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ship Mints <shipmints <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 17 Apr 2025 15:53:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
When there are no parsers present in a buffer, the most recent
treesit-language-at-point-default signals:
Debugger entered--Lisp error: (wrong-type-argument treesit-parser-p nil)
treesit-parser-language(nil)
eval((treesit-parser-language (car (treesit-parsers-at (point)))) nil)
pp-eval-expression((treesit-parser-language (car (treesit-parsers-at
(point)))))
funcall-interactively(pp-eval-expression (treesit-parser-language (car
(treesit-parsers-at (point)))))
I guess either the below needs to guard nil or treesit-parser-language (in
the C code) needs to accept nil and return nil?
(defun treesit-language-at-point-default (position)
(treesit-parser-language
(car (treesit-parsers-at position))))
-Stephane
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77870
; Package
emacs
.
(Thu, 17 Apr 2025 17:32:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 77870 <at> debbugs.gnu.org (full text, mbox):
Cc-ing Yuan to help to decide what to do in this case.
> When there are no parsers present in a buffer, the most recent
> treesit-language-at-point-default signals:
>
> Debugger entered--Lisp error: (wrong-type-argument treesit-parser-p nil)
> treesit-parser-language(nil)
> eval((treesit-parser-language (car (treesit-parsers-at (point)))) nil)
> pp-eval-expression((treesit-parser-language (car (treesit-parsers-at
> (point)))))
> funcall-interactively(pp-eval-expression (treesit-parser-language (car
> (treesit-parsers-at (point)))))
>
> I guess either the below needs to guard nil or treesit-parser-language (in
> the C code) needs to accept nil and return nil?
>
> (defun treesit-language-at-point-default (position)
> (treesit-parser-language
> (car (treesit-parsers-at position))))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77870
; Package
emacs
.
(Thu, 17 Apr 2025 22:32:03 GMT)
Full text and
rfc822 format available.
Message #11 received at 77870 <at> debbugs.gnu.org (full text, mbox):
Just had a user report this same problem via `indent-bars' in `python-ts-mode'[1]. `inferior-python-mode` spawns a temp buffer, and puts it into python-mode, which calls all the mode hooks, including ones which are expecting treesitter to be availabile. Normally not a problem, but now the new `treesit-language-at-point-default' throws:
treesit-language-at: Wrong type argument: treesit-parser-p, nil
in such buffers, since it does not check for "no parsers".
[1] https://github.com/jdtsmith/indent-bars/issues/103
Reply sent
to
Yuan Fu <casouri <at> gmail.com>
:
You have taken responsibility.
(Thu, 17 Apr 2025 23:59:04 GMT)
Full text and
rfc822 format available.
Notification sent
to
Ship Mints <shipmints <at> gmail.com>
:
bug acknowledged by developer.
(Thu, 17 Apr 2025 23:59:04 GMT)
Full text and
rfc822 format available.
Message #16 received at 77870-done <at> debbugs.gnu.org (full text, mbox):
> On Apr 17, 2025, at 3:30 PM, JD Smith <jdtsmith <at> gmail.com> wrote:
>
> Just had a user report this same problem via `indent-bars' in `python-ts-mode'[1]. `inferior-python-mode` spawns a temp buffer, and puts it into python-mode, which calls all the mode hooks, including ones which are expecting treesitter to be availabile. Normally not a problem, but now the new `treesit-language-at-point-default' throws:
>
> treesit-language-at: Wrong type argument: treesit-parser-p, nil
>
> in such buffers, since it does not check for "no parsers".
>
> [1] https://github.com/jdtsmith/indent-bars/issues/103
Yep, it should return nil if there’s no parser. I’ve pushed a fix to master. Sorry for the trouble guys.
Yuan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77870
; Package
emacs
.
(Fri, 18 Apr 2025 00:32:03 GMT)
Full text and
rfc822 format available.
Message #19 received at 77870-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Thu, Apr 17, 2025 at 19:58 Yuan Fu <casouri <at> gmail.com> wrote:
>
>
> > On Apr 17, 2025, at 3:30 PM, JD Smith <jdtsmith <at> gmail.com> wrote:
> >
> > Just had a user report this same problem via `indent-bars' in
> `python-ts-mode'[1]. `inferior-python-mode` spawns a temp buffer, and puts
> it into python-mode, which calls all the mode hooks, including ones which
> are expecting treesitter to be availabile. Normally not a problem, but now
> the new `treesit-language-at-point-default' throws:
> >
> > treesit-language-at: Wrong type argument: treesit-parser-p, nil
> >
> > in such buffers, since it does not check for "no parsers".
> >
> > [1] https://github.com/jdtsmith/indent-bars/issues/103
>
> Yep, it should return nil if there’s no parser. I’ve pushed a fix to
> master. Sorry for the trouble guys.
Thank you. All this great treesitter work is gonna pay off nicely. A few
minor hiccups are nothing.
>
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77870
; Package
emacs
.
(Fri, 18 Apr 2025 23:45:04 GMT)
Full text and
rfc822 format available.
Message #22 received at 77870-done <at> debbugs.gnu.org (full text, mbox):
> On Apr 17, 2025, at 5:31 PM, Ship Mints <shipmints <at> gmail.com> wrote:
>
> On Thu, Apr 17, 2025 at 19:58 Yuan Fu <casouri <at> gmail.com> wrote:
>
>
> > On Apr 17, 2025, at 3:30 PM, JD Smith <jdtsmith <at> gmail.com> wrote:
> >
> > Just had a user report this same problem via `indent-bars' in `python-ts-mode'[1]. `inferior-python-mode` spawns a temp buffer, and puts it into python-mode, which calls all the mode hooks, including ones which are expecting treesitter to be availabile. Normally not a problem, but now the new `treesit-language-at-point-default' throws:
> >
> > treesit-language-at: Wrong type argument: treesit-parser-p, nil
> > > in such buffers, since it does not check for "no parsers".
> >
> > [1] https://github.com/jdtsmith/indent-bars/issues/103
>
> Yep, it should return nil if there’s no parser. I’ve pushed a fix to master. Sorry for the trouble guys.
>
> Thank you. All this great treesitter work is gonna pay off nicely. A few minor hiccups are nothing.
Thanks for your encouragement! :-)
Yuan
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 17 May 2025 11:24:19 GMT)
Full text and
rfc822 format available.
This bug report was last modified 45 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.