Subject: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay.

From: Eli Zaretskii <[email-masked]>
Date: Sun, 01 Jan 2023 08:26:23 +0200

> From: Yuan Fu <[email-masked]>
> Date: Sat, 31 Dec 2022 14:06:20 -0800
> Cc: Alan Mackenzie <[email-masked]>,
>  [email-masked]
> 
> > On Dec 31, 2022, at 3:05 AM, Eli Zaretskii <[email-masked]> wrote:
> > 
> >> Date: Sat, 31 Dec 2022 10:29:21 +0000
> >> Cc: Eli Zaretskii <[email-masked]>, [email-masked], [email-masked]
> >> From: Alan Mackenzie <[email-masked]>
> >> 
> >> As you mentioned, the backtrace now looks a bit different, namely:
> >> 
> >> Error: treesit-query-error ("Node type error at" 195 "[\"break\" \"case\" \"co
> > 
> > Yuan, what is "195" in this error message?  According to the source
> > code, its is "error_offset+1", but what is that?  If it's a buffer
> > position, then how come we see 195 when the buffer has only "char" in
> > it?
> 
> It is the position of the error in the query string. Any suggestion to make that clearer in the message? Maybe “Node type error in the query string at”?

And the "query string" is that long string enclosed in [] brackets?

"Node type error at query string position" is the best I can come up
with, but the problem is that figuring out where is that is not easy,
given all the backslashes.  Not sure what we can do about that,
though.