From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 30 07:25:00 2022 Received: (at submit) by debbugs.gnu.org; 30 Dec 2022 12:25:00 +0000 Received: from localhost ([127.0.0.1]:33675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBERX-0006Og-LA for submit@debbugs.gnu.org; Fri, 30 Dec 2022 07:24:59 -0500 Received: from lists.gnu.org ([209.51.188.17]:43666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBERV-0006OY-E3 for submit@debbugs.gnu.org; Fri, 30 Dec 2022 07:24:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBERS-0002kR-5Z for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2022 07:24:56 -0500 Received: from mx3.muc.de ([193.149.48.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBERQ-0007nP-9I for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2022 07:24:53 -0500 Received: (qmail 72923 invoked by uid 3782); 30 Dec 2022 13:24:39 +0100 Received: from acm.muc.de (p4fe15ce1.dip0.t-ipconnect.de [79.225.92.225]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 30 Dec 2022 13:24:38 +0100 Received: (qmail 14856 invoked by uid 1000); 30 Dec 2022 12:24:38 -0000 Date: Fri, 30 Dec 2022 12:24:38 +0000 To: bug-gnu-emacs@gnu.org Subject: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.5; envelope-from=acm@muc.de; helo=mx3.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hello, Emacs. In the emacs-29 branch, with the latest commit being: commit 558b59d81b938fc434e62523106360b9704c88e2 (HEAD -> emacs-29, origin/emacs-29, origin/HEAD) Author: Yuan Fu Date: Thu Dec 29 11:52:06 2022 -0800 Add color fontification in css-ts-mode (bug#60405) : (i) emacs -Q (ii) (setq backtrace-on-redisplay-error t) (iii) C-x b string.cc (iv) M-x c++-ts-mode (v) Type "char" (without the quote marks). This throws an exception in the redisplay code. The backtrace in the *Redisplay-trace* buffer is: Error: treesit-query-error ("Node type error at" 195 "Debug the query with `treesit-query-validate'") debug-early-backtrace() debug-early(error (treesit-query-error "Node type error at" 195 "Debug the query with `treesit-query-validate'")) treesit-font-lock-fontify-region(1 5 nil) font-lock-default-fontify-region(1 5 nil) font-lock-fontify-region(1 5) #f(compiled-function (fun) #)(font-lock-fontify-region) jit-lock--run-functions(1 5) jit-lock-fontify-now(1 5) jit-lock-function(1) redisplay_internal\ \(C\ function\)() .. That this insertion causes an exception is clearly a bug. But the contents of the backtrace seem to me to be less helpful than they might be. What does the "the" in "the query" refer to? There is no referent yet established. What does the 195 refer to? It clearly isn't a buffer position, which is what it would mean in lots of other Emacs error messages. Just as a matter of interest, in c-ts-mode, the above actions run without problem. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 30 20:02:47 2022 Received: (at 60427) by debbugs.gnu.org; 31 Dec 2022 01:02:47 +0000 Received: from localhost ([127.0.0.1]:36300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBQGs-0000gT-KB for submit@debbugs.gnu.org; Fri, 30 Dec 2022 20:02:46 -0500 Received: from mail-pj1-f45.google.com ([209.85.216.45]:51923) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBQGp-0000gE-Sg for 60427@debbugs.gnu.org; Fri, 30 Dec 2022 20:02:44 -0500 Received: by mail-pj1-f45.google.com with SMTP id n12so11020006pjp.1 for <60427@debbugs.gnu.org>; Fri, 30 Dec 2022 17:02:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2uWIxaOBp0+tFDB++fFOLunD9LZ2iIAiSB2NvoWci4Q=; b=jGo+o9qmFMz5iPV4mw+bbZQEMgH7NCFsEjoa7Vk8r/9SQcLB0eqz+F4k/PLG4/zZnV SzcBuWe1hf/6/ps0MddJTb4anj65ALC1oNdqqWgX1V7lXUpajX/N5OxUljX6uJvdpt/H 1Qjrz+WvLmersNYIw2bBQg8QuJ1pRk1ENWaRqDRdSDaPgiGwsNXQvhhdZ248y0sD65X5 bDnwpZRNA7aFhTWd2+jQnwiA0MYoJdLckktM/S8/Tv/Nq+PoVTFl9dQrF9ltawuzr2QS l65j2z9yFtY7kkd90JMB6+zk7Yh0F9d7U3TTIdRrMoxx4xztHf1SDbsjZBCrMSE3kSXr 2CPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2uWIxaOBp0+tFDB++fFOLunD9LZ2iIAiSB2NvoWci4Q=; b=LZ+xqnoORcNOt0mRFwLf/On7kwY4r8RZIaq9LtPXezJSzk4jeZ3FJe2gyQcssbHW+d MbeJTThqVu90OPSOCRxvuX2P43EYqaU+2ERVQoHiodf/e6Sg6LvH7T6bhDO8ZWroAqVO z5zu9X+yNW9a8cg8C2RVuPEKSg9nGmG4uOppBYyWyafzs72zKFLCKqFIWRRcY3MAWgVp Lv4qb3ulkVtjO7MGPGpQe+7Fg+NgJB3V/uRf+P86o5Jel6wngkx9YLMo3grADfmbyFP4 msa2d73CIjG23T+u3xTxdfm4DR65cjpeQeHdgRRvIwvxkWHtG0rOXkOfJcPNWspQ3m9u UDrQ== X-Gm-Message-State: AFqh2kqDAyCyd6XNNxQ1mGwquXrZCcsjIPR1e5R5YQ5XUXO+LLYIDZz8 v+N2MtFGdC+Eyk8JAKdGxDUHXkO48ck= X-Google-Smtp-Source: AMrXdXsefCAY0S/9EnKXn477R8Wtfk9ySvgFGNVxeJTaPBeF6HthLipOym+DcXxhYKw1aC5oWYS7Hg== X-Received: by 2002:a05:6a20:670a:b0:a7:8b3e:1207 with SMTP id q10-20020a056a20670a00b000a78b3e1207mr52421256pzh.13.1672448557714; Fri, 30 Dec 2022 17:02:37 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id i12-20020a63584c000000b004785a63b44bsm13101769pgm.43.2022.12.30.17.02.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Dec 2022 17:02:37 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. From: Yuan Fu In-Reply-To: Date: Fri, 30 Dec 2022 17:02:36 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> References: To: Alan Mackenzie X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60427 Cc: 60427@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Dec 30, 2022, at 4:24 AM, Alan Mackenzie wrote: >=20 > Hello, Emacs. >=20 > In the emacs-29 branch, with the latest commit being: >=20 > commit 558b59d81b938fc434e62523106360b9704c88e2 (HEAD -> emacs-29, = origin/emacs-29, origin/HEAD) > Author: Yuan Fu > Date: Thu Dec 29 11:52:06 2022 -0800 >=20 > Add color fontification in css-ts-mode (bug#60405) >=20 > : > (i) emacs -Q > (ii) (setq backtrace-on-redisplay-error t) > (iii) C-x b string.cc > (iv) M-x c++-ts-mode > (v) Type "char" (without the quote marks). >=20 > This throws an exception in the redisplay code. The backtrace in the > *Redisplay-trace* buffer is: >=20 > Error: treesit-query-error ("Node type error at" 195 "Debug the query = with `treesit-query-validate'") > debug-early-backtrace() > debug-early(error (treesit-query-error "Node type error at" 195 = "Debug the query with `treesit-query-validate'")) > treesit-font-lock-fontify-region(1 5 nil) > font-lock-default-fontify-region(1 5 nil) > font-lock-fontify-region(1 5) > #f(compiled-function (fun) #)(font-lock-fontify-region) > jit-lock--run-functions(1 5) > jit-lock-fontify-now(1 5) > jit-lock-function(1) > redisplay_internal\ \(C\ function\)() >=20 > .. That this insertion causes an exception is clearly a bug. >=20 > But the contents of the backtrace seem to me to be less helpful than = they > might be. What does the "the" in "the query" refer to? There is no > referent yet established. What does the 195 refer to? It clearly = isn't > a buffer position, which is what it would mean in lots of other Emacs > error messages. >=20 > Just as a matter of interest, in c-ts-mode, the above actions run = without > problem. Thank you! I couldn=E2=80=99t reproduce it on the latest trunk, even = though I checked that there isn=E2=80=99t any relevant change between = that commit and the latest one. I made a small modification to treesit.c = so now the signal will contain the source of the query that caused the = error. Could you try again with trunk and show me the backtrace? This = time it should contain the problematic query. Yuan= From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 01:42:12 2022 Received: (at 60427) by debbugs.gnu.org; 31 Dec 2022 06:42:12 +0000 Received: from localhost ([127.0.0.1]:36399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBVZM-0001Dq-5n for submit@debbugs.gnu.org; Sat, 31 Dec 2022 01:42:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBVZK-0001Dd-C0 for 60427@debbugs.gnu.org; Sat, 31 Dec 2022 01:42:10 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBVZE-0003XB-GE; Sat, 31 Dec 2022 01:42:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=NTi2+HxwYnBVwTxCRGNkU48eJPp8PvMzB31aSOBHZ7o=; b=hTnORFx5Glnj1i9ysEf+ AcGdDzGuMZzNQf2Rc8LkpmqAIcVM1B6dkWHjzCcvvYzytrKdsCyU+EItU1KtcOWGhyskWsB69u6Pz 50hNxQY2qhTaRUa1nl87m77LykgzqjYyLnxcWafuq3genfDNdzEsQOm36SL1zN7zAqBcn3eA2KBbL JPVdy7I9JWlmW+NP5NpcYNsbXngGX39CWq2O9WOeQ9S319JrxaMoHYdqb6IzG0p9B8Mc9EkcDVmpZ dbAAyxQcJIGInA9hhvCzxGjGwNrh9/cyiH3CsFjpPUa8qggjYWX8KlvVBezXaS0pcz5BTwB8Rp2vC WHldkmwcvyynZw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBVZD-0000X7-7C; Sat, 31 Dec 2022 01:42:03 -0500 Date: Sat, 31 Dec 2022 08:42:04 +0200 Message-Id: <838rio5b2b.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> (message from Yuan Fu on Fri, 30 Dec 2022 17:02:36 -0800) Subject: Re: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. References: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60427 Cc: acm@muc.de, 60427@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 60427@debbugs.gnu.org > From: Yuan Fu > Date: Fri, 30 Dec 2022 17:02:36 -0800 > > Thank you! I couldn’t reproduce it on the latest trunk AFAIU, the report was about the emacs-29 branch, not about the master branch. So what did you mean by "latest trunk" above? From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 01:55:53 2022 Received: (at 60427) by debbugs.gnu.org; 31 Dec 2022 06:55:53 +0000 Received: from localhost ([127.0.0.1]:36439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBVma-0001eE-Pg for submit@debbugs.gnu.org; Sat, 31 Dec 2022 01:55:53 -0500 Received: from mail-pl1-f174.google.com ([209.85.214.174]:36688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBVmZ-0001e2-BD for 60427@debbugs.gnu.org; Sat, 31 Dec 2022 01:55:51 -0500 Received: by mail-pl1-f174.google.com with SMTP id 20so10498945plo.3 for <60427@debbugs.gnu.org>; Fri, 30 Dec 2022 22:55:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pO9CtC3li/4J8qdGuSKx8G9aSzF+5XxsIZ3LFfobZ64=; b=AFcOm31VJs4Ua8lfqh8oCF1vj/P8CtvDp/2OggETCoYs32JGJrlWbKAGCtHg72Q8Rs K+d13ILc/gwcWg0d13K82dUZCY7tOVpQH9NNZqOj4rJzYy4yzeBM5KV9QCvH2J9m4nc1 li0zhQdOb89ngOTST5wS9Sc7qfMwArB5IwVv91ZlF9nss+BbU0fzkt5BnixpHY2xiyrz zwEhOrISi1Dg0w75Pl2MosVGma7dRQGZYcOMLHhzZ7LSxJGjKufqf5yTqfnlaEbRAoes agsghoqItc2006I5+krQwafYJbqPS75UIAON6SutHWwAv/GW/wPTfJvbgXjXfNWvsJjF oBYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pO9CtC3li/4J8qdGuSKx8G9aSzF+5XxsIZ3LFfobZ64=; b=cBA/NNoNk6F3zDP18iX5Xc8lzMftLo0FM1v4cEKrpZ87MOZC45ZCsY3Guecp5XwI0+ w5rbsHZqimBKUG7PcC628yx+6vCtofAYu7dj5Cl2HDx4Rqhu0vTZrjitXrL9MSIeB6s5 vP2LLFnYY7wjiE/orBOpMm8h6H0CJ2puSZKlVQhvWCUDn1dsN2DpVbsws4sUrR1dyP3O jp4FRcpIILmRjBQstI2pyZQUxqSdxsNpMaIoaJTA4ycF92aqhJQFEvm9AVBJU0eW7801 X35Hy1hRgga2JBEa3UVpp1qdzSc8k8R+GdJOmfjOQHDfYQdd2dt50omSrpCSX/tSydnB pxfg== X-Gm-Message-State: AFqh2koMoSHVKVRgX6Gm8KMcT+fs8pWvbffrKorkQqzfBiKW9lYU6pvz 2UJlcEkUP9r2DguBrw7pvx4= X-Google-Smtp-Source: AMrXdXs3wF/gnq0oBA/C3s4Tfpba8+Sc8tUQrFgw89t7mas/Yk5CQ/a0JsujQg5ghi4+u3Jotx5MMg== X-Received: by 2002:a17:902:ab11:b0:191:33e2:452d with SMTP id ik17-20020a170902ab1100b0019133e2452dmr32566635plb.24.1672469745224; Fri, 30 Dec 2022 22:55:45 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id n3-20020a170902e54300b001745662d568sm16122901plf.278.2022.12.30.22.55.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Dec 2022 22:55:44 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. From: Yuan Fu In-Reply-To: <838rio5b2b.fsf@gnu.org> Date: Fri, 30 Dec 2022 22:55:41 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <44090371-BC18-4F3C-AC59-D9B34E1CE42E@gmail.com> References: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> <838rio5b2b.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60427 Cc: acm@muc.de, 60427@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Dec 30, 2022, at 10:42 PM, Eli Zaretskii wrote: >=20 >> Cc: 60427@debbugs.gnu.org >> From: Yuan Fu >> Date: Fri, 30 Dec 2022 17:02:36 -0800 >>=20 >> Thank you! I couldn=E2=80=99t reproduce it on the latest trunk >=20 > AFAIU, the report was about the emacs-29 branch, not about the master > branch. So what did you mean by "latest trunk" above? Sorry, imprecise wording, I mean latest emacs-29 :-) Yuan= From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 05:29:30 2022 Received: (at 60427) by debbugs.gnu.org; 31 Dec 2022 10:29:30 +0000 Received: from localhost ([127.0.0.1]:36593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBZ7J-000818-P1 for submit@debbugs.gnu.org; Sat, 31 Dec 2022 05:29:30 -0500 Received: from mx3.muc.de ([193.149.48.5]:58224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBZ7I-00080o-4j for 60427@debbugs.gnu.org; Sat, 31 Dec 2022 05:29:28 -0500 Received: (qmail 85251 invoked by uid 3782); 31 Dec 2022 11:29:22 +0100 Received: from acm.muc.de (p2e5d5394.dip0.t-ipconnect.de [46.93.83.148]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 31 Dec 2022 11:29:21 +0100 Received: (qmail 11410 invoked by uid 1000); 31 Dec 2022 10:29:21 -0000 Date: Sat, 31 Dec 2022 10:29:21 +0000 To: Yuan Fu Subject: Re: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. Message-ID: References: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> <838rio5b2b.fsf@gnu.org> <44090371-BC18-4F3C-AC59-D9B34E1CE42E@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <44090371-BC18-4F3C-AC59-D9B34E1CE42E@gmail.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60427 Cc: acm@muc.de, Eli Zaretskii , 60427@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Yuan. On Fri, Dec 30, 2022 at 22:55:41 -0800, Yuan Fu wrote: > > On Dec 30, 2022, at 10:42 PM, Eli Zaretskii wrote: > >> Cc: 60427@debbugs.gnu.org > >> From: Yuan Fu > >> Date: Fri, 30 Dec 2022 17:02:36 -0800 > >> Thank you! I couldn’t reproduce it on the latest trunk > > AFAIU, the report was about the emacs-29 branch, not about the master > > branch. So what did you mean by "latest trunk" above? > Sorry, imprecise wording, I mean latest emacs-29 :-) I've just downloaded the latest commits in the emacs-29 branch, bootstrapped, and I still see the problem, both in X GUI and on a Linux console. Just as a matter of interest, I get the error after typing the h in "char", so the problem would appear not to be related to the specific character string "char". As you mentioned, the backtrace now looks a bit different, namely: Error: treesit-query-error ("Node type error at" 195 "[\"break\" \"case\" \"const\" \"continue\" \"default\" \"do\" \"else\" \"enum\" \"extern\" \"for\" \"goto\" \"if\" \"inline\" \"register\" \"return\" \"sizeof\" \"static\" \"struct\" \"\switch\" \"typedef\" \"union\" \"volatile\" \"while\" \"and\" \"and_eq\" \"bitand\" \"bitor\" \"catch\" \"class\" \"co_await\" \"co_return\" \"co_yield\" \"compl\" \"concept\" \"consteval\" \"constexpr\" \"constinit\" \"decltype\" \"delete\\" \"explicit\" \"final\" \"friend\" \"mutable\" \"namespace\" \"new\" \"noexcept\" \"not\" \"not_eq\" \"operator\" \"or\" \"or_eq\" \"override\" \"private\" \"protected\" \"public\" \"requires\" \"template\" \"throw\" \"try\" \"typename\"\ \"using\" \"virtual\" \"xor\" \"xor_eq\"] @font-lock-keyword-face (auto) @font-lock-keyword-face (this) @font-lock-keyword-face" "Debug the query with `treesit-query-validate'") debug-early-backtrace() debug-early(error (treesit-query-error "Node type error at" 195 "[\"break\" \"case\" \"const\" \"continue\" \"default\" \"do\" \"else\" \"enum\" \"extern\" \"for\" \"goto\" \"if\" \"inline\" \"register\" \"return\" \"sizeof\" \"static\" \\"struct\" \"switch\" \"typedef\" \"union\" \"volatile\" \"while\" \"and\" \"and_eq\" \"bitand\" \"bitor\" \"catch\" \"class\" \"co_await\" \"co_return\" \"co_yield\" \"compl\" \"concept\" \"consteval\" \"constexpr\" \"constinit\" \"declty\pe\" \"delete\" \"explicit\" \"final\" \"friend\" \"mutable\" \"namespace\" \"new\" \"noexcept\" \"not\" \"not_eq\" \"operator\" \"or\" \"or_eq\" \"override\" \"private\" \"protected\" \"public\" \"requires\" \"template\" \"throw\" \"try\"\ \"typename\" \"using\" \"virtual\" \"xor\" \"xor_eq\"] @font-lock-keyword-face (auto) @font-lock-keyword-face (this) @font-lock-keyword-face" "Debug the query with `treesit-query-validate'")) treesit-font-lock-fontify-region(1 5 nil) font-lock-default-fontify-region(1 5 nil) font-lock-fontify-region(1 5) #f(compiled-function (fun) #)(font-lock-fontify-region) jit-lock--run-functions(1 5) jit-lock-fontify-now(1 5) jit-lock-function(1) redisplay_internal\ \(C\ function\)() I forgot to give my configuration arguments, maybe that has something to do with it. They're: ./configure --with-gif=no --with-tiff=no --with-gpm --with-native-compilation .. > Yuan -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 06:02:51 2022 Received: (at 60427) by debbugs.gnu.org; 31 Dec 2022 11:02:51 +0000 Received: from localhost ([127.0.0.1]:36643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBZda-0000pI-Up for submit@debbugs.gnu.org; Sat, 31 Dec 2022 06:02:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBZdZ-0000p2-AP for 60427@debbugs.gnu.org; Sat, 31 Dec 2022 06:02:49 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBZdT-0001xS-3O; Sat, 31 Dec 2022 06:02:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=fSEQOcXLQCQnHJmdM6pagvJMVtIrzbrrFYkKaHti9q0=; b=GGsRobCSgGKS YUU3XVbsf0knrqqHl6uXM3nrVLYJO/Pz8rf5EFtqM5MaY9ro39oNbeyuIp28a9Qgrmld0gdM3UVkX oMz4IGnI0vqp/IHDt+JCFB32ZLZjvfOyPYfiJqApXl244F+zJBE9eYIZRsVKIikPXbuATU2Aa0huW cxoLLYzub/xl8wIQTbQdxcHrXOfu2lU87TqS2XAroV69lIYnwzagqJCTRJfXWyUfVEH6ChLiMcfz8 NfQaOUT+8TPmXhhJRzYghx0vx+rklMmKJSdR+bfvEoEphA5ZSdbkctmDrpujulXmtj3YE5b7T/Rxj AlEeKUwg18Dq69dF66oMhQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBZdA-0001kv-RB; Sat, 31 Dec 2022 06:02:42 -0500 Date: Sat, 31 Dec 2022 13:02:26 +0200 Message-Id: <83r0wf4z0d.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-Reply-To: (message from Alan Mackenzie on Sat, 31 Dec 2022 10:29:21 +0000) Subject: Re: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. References: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> <838rio5b2b.fsf@gnu.org> <44090371-BC18-4F3C-AC59-D9B34E1CE42E@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60427 Cc: casouri@gmail.com, 60427@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 31 Dec 2022 10:29:21 +0000 > Cc: Eli Zaretskii , 60427@debbugs.gnu.org, acm@muc.de > From: Alan Mackenzie > > I've just downloaded the latest commits in the emacs-29 branch, > bootstrapped, and I still see the problem, both in X GUI and on a Linux > console. Just as a matter of interest, I get the error after typing the > h in "char", so the problem would appear not to be related to the > specific character string "char". I cannot reproduce this with the current emacs-29 branch, neither with native-compilation nor without it. I also tried in a -nw session, and couldn't reproduce there as well. How did you get and build the C++ grammar file for tree-sitter? If you cloned their repository, what is the last commit from which you produced the shared library file? And which version of the tree-sitter library are you using? Finally, is the recipe you posted complete? are you sure you did nothing else since starting Emacs? From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 06:06:03 2022 Received: (at 60427) by debbugs.gnu.org; 31 Dec 2022 11:06:04 +0000 Received: from localhost ([127.0.0.1]:36648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBZgh-0000vr-J3 for submit@debbugs.gnu.org; Sat, 31 Dec 2022 06:06:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBZgg-0000vL-8y for 60427@debbugs.gnu.org; Sat, 31 Dec 2022 06:06:02 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBZga-0005CO-Qj; Sat, 31 Dec 2022 06:05:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=POMAO/nOxhUCh4Q3Kw+kP64qcvf3jGc+exSMeoUgncE=; b=C9IjA6fRoy15 Br+zHg+3liUOAqSL0i5uIQtQ2es/LhQNXWg3Oj3GP1fu7MNxki+yBc906xacSdn1sCrGZJAWjGnpA Ih2bGKEEGBa2Mm3c/t2g3+oO+iEkJ6AT6S3rtAjODl8L9o3PGI4MImBNozetNhyucKHwE939Bk9nU s9NBX2j+Jkg91rUuAW61fbye06xYdHDC+RZJC4jE6UVnG6yXq4hBHzsQWYvrCf/onegOQDCMbQW2v UuH0llPMw0q2WaSPVOsE48bp9/leRK1y9yT/eSa48omGlzW1N+VDpAvAgjRUofEamfYb4YJsiUeL0 V2MqOjPHuS0HZibbzG16ZA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBZga-0001AI-0o; Sat, 31 Dec 2022 06:05:56 -0500 Date: Sat, 31 Dec 2022 13:05:57 +0200 Message-Id: <83pmbz4yui.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-Reply-To: (message from Alan Mackenzie on Sat, 31 Dec 2022 10:29:21 +0000) Subject: Re: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. References: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> <838rio5b2b.fsf@gnu.org> <44090371-BC18-4F3C-AC59-D9B34E1CE42E@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60427 Cc: acm@muc.de, casouri@gmail.com, 60427@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 31 Dec 2022 10:29:21 +0000 > Cc: Eli Zaretskii , 60427@debbugs.gnu.org, acm@muc.de > From: Alan Mackenzie > > 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? From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 17:06:34 2022 Received: (at 60427) by debbugs.gnu.org; 31 Dec 2022 22:06:34 +0000 Received: from localhost ([127.0.0.1]:39976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBjzt-0001Lg-Qo for submit@debbugs.gnu.org; Sat, 31 Dec 2022 17:06:34 -0500 Received: from mail-pl1-f170.google.com ([209.85.214.170]:35425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBjzr-0001LS-Cj for 60427@debbugs.gnu.org; Sat, 31 Dec 2022 17:06:32 -0500 Received: by mail-pl1-f170.google.com with SMTP id y19so6396423plb.2 for <60427@debbugs.gnu.org>; Sat, 31 Dec 2022 14:06:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8mAsuiK8AM2692rydj/jm8z47v/eucZNtZCiYoWs3/0=; b=XaAQYikVw1wIkCUM1ibtNrEEgYuytQ8lrmJ5TWoe/ltBH1TS82hUHyTC6iptc56yPO e7KuFbnwgMgY6fxVlqC6w/TgCm+An0S5cIznpJWHDJSUrid8RMHhLmpO/KLFXwJtk28d URMs6BtkoMDdjqDzqM4P+QNwBpS8js6SKUAPCuHkq4ZLLcpUWas4Ggae6PdNeid+jUIT VEIi65TA0WahMQ0WtKSgkY4/FDWTRlPQ+w9A5GiAsS9LJ0jS6ajVFc5sr+O6xOUbbcmo yG3smMxjXXUYGFwZ701enHqOR0MG40JVzm+J2wZHtjSCmxRjc2cKxidKE4isWe0gpggf ifVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8mAsuiK8AM2692rydj/jm8z47v/eucZNtZCiYoWs3/0=; b=Ampl3Be40aXzccLtSXb9hT/CgTKxyXAj1EoQk+UXANARYZYcgySAvve2coRLjODvZG lT00HpxVU9A072H7YTE7Z61GE2I7DyVjG9XkZrF3CSGu4qn54dpAZNEccTzdaXGTjz6j AQiNXtvpWCScg4I3U/AIyubOftfHoFqcJJuBAUhBPgVe9fuAuvwjeMB0/0MNepiP56KZ z2uPVWXzr73zR50zszBV1PiAsSEfhHA2iiJQ43mbE/0xEfrpN8JBOwHs6b51PSEfdXR6 w2/tjVRz8OeIYTNUNvQtMSCPnKTwCGEr7O5AMNrxe7Rv/IXNke6mlHLqnta4Al8grfEf I/0A== X-Gm-Message-State: AFqh2ko5JMWN8/cgTbh58RTHpbFcf8Ai8rITZm3YxipWoJijZZWb7Ma9 tWbCp2/ZKpt44Ry2e73u6O6RR5wx+7o= X-Google-Smtp-Source: AMrXdXtm/nvC6mp65eXDDTfyKrkVj6OlKaTqnaST9bWdDJ+UN6gab4XEE4jI7TFVQF7aRubG2CjyuA== X-Received: by 2002:a17:902:6a83:b0:192:7258:dfb1 with SMTP id n3-20020a1709026a8300b001927258dfb1mr27288985plk.59.1672524384629; Sat, 31 Dec 2022 14:06:24 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id p8-20020a170902780800b001782aab6318sm1835695pll.68.2022.12.31.14.06.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Dec 2022 14:06:24 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. From: Yuan Fu In-Reply-To: <83pmbz4yui.fsf@gnu.org> Date: Sat, 31 Dec 2022 14:06:20 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <37847B53-26C1-4B7A-9042-CA74EA239427@gmail.com> References: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> <838rio5b2b.fsf@gnu.org> <44090371-BC18-4F3C-AC59-D9B34E1CE42E@gmail.com> <83pmbz4yui.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60427 Cc: Alan Mackenzie , 60427@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Dec 31, 2022, at 3:05 AM, Eli Zaretskii wrote: >=20 >> Date: Sat, 31 Dec 2022 10:29:21 +0000 >> Cc: Eli Zaretskii , 60427@debbugs.gnu.org, acm@muc.de >> From: Alan Mackenzie >>=20 >> As you mentioned, the backtrace now looks a bit different, namely: >>=20 >> Error: treesit-query-error ("Node type error at" 195 "[\"break\" = \"case\" \"co >=20 > 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 =E2=80=9CNode type error in the = query string at=E2=80=9D? Yuan= From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 17:11:13 2022 Received: (at 60427) by debbugs.gnu.org; 31 Dec 2022 22:11:13 +0000 Received: from localhost ([127.0.0.1]:39985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBk4O-0001TO-V9 for submit@debbugs.gnu.org; Sat, 31 Dec 2022 17:11:13 -0500 Received: from mail-pj1-f41.google.com ([209.85.216.41]:45759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBk4M-0001T9-NB for 60427@debbugs.gnu.org; Sat, 31 Dec 2022 17:11:11 -0500 Received: by mail-pj1-f41.google.com with SMTP id v13-20020a17090a6b0d00b00219c3be9830so24768246pjj.4 for <60427@debbugs.gnu.org>; Sat, 31 Dec 2022 14:11:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iamhDC6kMgxyM35U5Yn6BCJaIjsYTZtQWB9iU78krT0=; b=pN0rf2uV/b8rHSQHbMuz9hVQx7HkyQ8vnDv9Kt7NwzFl88pzXtbgPfAiB5VyEcaxTM PNghjQoBQJCE2dc9EuLkhq7ASNdE0kqfsoJKzEDDRnLYLflZw6PnHYxj5azMAFk4M5ju vAsEkPDUbavSv6bkr3R67dIQ2JG/rBADXk1jD956QDnYWQ2Sw5ihaN9j1VYiiF2UzIB7 K960Mgu58BrYyhijsc8qPdDI/ofpnKsOrTCRio7+hX/e91kCIq/vS8eQUDWijW1TpX/d QsonPRNKE8nBpYF/iHf/9vAtL1f+0YH79BRo35N7mzAgORh/HKy9T0q15ZDw56HqZu1Q Y2NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iamhDC6kMgxyM35U5Yn6BCJaIjsYTZtQWB9iU78krT0=; b=T0nb50iX52dKoaWBpSVIbOIMtIOUhIjM8Aiq6Skbtgv+yprLgHCRnmuQaQtOzaIWZo LZg+tSxmZ7T7tbRfF5YHefVdjaAPUoEIgXp7wT+FCscdLcaEH0TLX892Z9cAb2rANqsx ec0EAbCAaysEJKgwcQcZrNtj3rm2iJ0XDZw7U6nDfIrmbGfPybMqdY2r609aAvwpEXeJ NUsaT48VRCZCooGOjlMm6nY/lMFVt0Juuoh1i8D1FoJUn+lkLnC5wV69WEGxDo4rB0Ko CwyqjEi2S2PTIoaEcd0t71tLU8J52cORGAC8QNYPCXMxSawCJy1XNREnDt/2UA+rOGbW ciWg== X-Gm-Message-State: AFqh2kpc1XmThLejmZz+mDuMF8oVvu31bBD1+wXNw+81pWQ5itpp1y98 kihUT8NX/EZha3sMItYTHqU= X-Google-Smtp-Source: AMrXdXtkAv8lfZcZr3Xxbic/8A21HRWr5lYtxnZKddQ0KNe0T9j5EvCESr59cCn1qV6INOu29qCkIQ== X-Received: by 2002:a17:902:f68a:b0:192:49f4:fe67 with SMTP id l10-20020a170902f68a00b0019249f4fe67mr52663299plg.57.1672524664934; Sat, 31 Dec 2022 14:11:04 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id a3-20020a170902710300b00186b758c9fasm17261265pll.33.2022.12.31.14.11.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Dec 2022 14:11:04 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. From: Yuan Fu In-Reply-To: Date: Sat, 31 Dec 2022 14:11:03 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <1A0CC058-2A6C-47D6-8339-D522B8854E16@gmail.com> References: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> <838rio5b2b.fsf@gnu.org> <44090371-BC18-4F3C-AC59-D9B34E1CE42E@gmail.com> To: Alan Mackenzie X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60427 Cc: Eli Zaretskii , 60427@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Dec 31, 2022, at 2:29 AM, Alan Mackenzie wrote: >=20 > Hello, Yuan. >=20 > On Fri, Dec 30, 2022 at 22:55:41 -0800, Yuan Fu wrote: >=20 >=20 >>> On Dec 30, 2022, at 10:42 PM, Eli Zaretskii wrote: >=20 >>>> Cc: 60427@debbugs.gnu.org >>>> From: Yuan Fu >>>> Date: Fri, 30 Dec 2022 17:02:36 -0800 >=20 >>>> Thank you! I couldn=E2=80=99t reproduce it on the latest trunk >=20 >>> AFAIU, the report was about the emacs-29 branch, not about the = master >>> branch. So what did you mean by "latest trunk" above? >=20 >> Sorry, imprecise wording, I mean latest emacs-29 :-) >=20 > I've just downloaded the latest commits in the emacs-29 branch, > bootstrapped, and I still see the problem, both in X GUI and on a = Linux > console. Just as a matter of interest, I get the error after typing = the > h in "char", so the problem would appear not to be related to the > specific character string "char". >=20 > As you mentioned, the backtrace now looks a bit different, namely: >=20 > Error: treesit-query-error ("Node type error at" 195 "[\"break\" = \"case\" \"const\" \"continue\" \"default\" \"do\" \"else\" \"enum\" = \"extern\" \"for\" \"goto\" \"if\" \"inline\" \"register\" \"return\" = \"sizeof\" \"static\" \"struct\" \"\switch\" \"typedef\" \"union\" = \"volatile\" \"while\" \"and\" \"and_eq\" \"bitand\" \"bitor\" \"catch\" = \"class\" \"co_await\" \"co_return\" \"co_yield\" \"compl\" \"concept\" = \"consteval\" \"constexpr\" \"constinit\" \"decltype\" \"delete\\" = \"explicit\" \"final\" \"friend\" \"mutable\" \"namespace\" \"new\" = \"noexcept\" \"not\" \"not_eq\" \"operator\" \"or\" \"or_eq\" = \"override\" \"private\" \"protected\" \"public\" \"requires\" = \"template\" \"throw\" \"try\" \"typename\"\ \"using\" \"virtual\" = \"xor\" \"xor_eq\"] @font-lock-keyword-face (auto) = @font-lock-keyword-face (this) @font-lock-keyword-face" "Debug the query = with `treesit-query-validate'") > debug-early-backtrace() > debug-early(error (treesit-query-error "Node type error at" 195 = "[\"break\" \"case\" \"const\" \"continue\" \"default\" \"do\" \"else\" = \"enum\" \"extern\" \"for\" \"goto\" \"if\" \"inline\" \"register\" = \"return\" \"sizeof\" \"static\" \\"struct\" \"switch\" \"typedef\" = \"union\" \"volatile\" \"while\" \"and\" \"and_eq\" \"bitand\" \"bitor\" = \"catch\" \"class\" \"co_await\" \"co_return\" \"co_yield\" \"compl\" = \"concept\" \"consteval\" \"constexpr\" \"constinit\" \"declty\pe\" = \"delete\" \"explicit\" \"final\" \"friend\" \"mutable\" \"namespace\" = \"new\" \"noexcept\" \"not\" \"not_eq\" \"operator\" \"or\" \"or_eq\" = \"override\" \"private\" \"protected\" \"public\" \"requires\" = \"template\" \"throw\" \"try\"\ \"typename\" \"using\" \"virtual\" = \"xor\" \"xor_eq\"] @font-lock-keyword-face (auto) = @font-lock-keyword-face (this) @font-lock-keyword-face" "Debug the query = with `treesit-query-validate'")) > treesit-font-lock-fontify-region(1 5 nil) > font-lock-default-fontify-region(1 5 nil) > font-lock-fontify-region(1 5) > #f(compiled-function (fun) #)(font-lock-fontify-region) > jit-lock--run-functions(1 5) > jit-lock-fontify-now(1 5) > jit-lock-function(1) > redisplay_internal\ \(C\ function\)() >=20 >=20 > I forgot to give my configuration arguments, maybe that has something = to > do with it. They're: >=20 > ./configure --with-gif=3Dno --with-tiff=3Dno --with-gpm = --with-native-compilation >=20 > .. As Eli observed, this seems like a mismatch between the C++ language = grammar you used and the queries used by c++-ts-mode. We need to pin = down or declare the version of the language grammar a major mode is = written on. Maybe in NEWS file? Yuan= From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 01 01:22:30 2023 Received: (at 60427) by debbugs.gnu.org; 1 Jan 2023 06:22:30 +0000 Received: from localhost ([127.0.0.1]:40182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBrjq-0005wh-CR for submit@debbugs.gnu.org; Sun, 01 Jan 2023 01:22:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBrjn-0005wS-MR for 60427@debbugs.gnu.org; Sun, 01 Jan 2023 01:22:29 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBrji-0002mf-Fa; Sun, 01 Jan 2023 01:22:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=XfmjRzSjGhVWney3SctGohfjvFxuqMG68W/NvxHJwms=; b=M9FNEz4nSoT4 XnChHmP8OUU7z24iHCLDdyibQC+dIgClD5+vN0MGgHzGydDSDRwlPsN0AQLj3QYasq/HHkPUY0Wr6 9BkvMwUNINT1RdsKJniNTLZhuNjE7JlHOZUdbBgDQEN0sIMHuhthaxFbrjMU6uiCPjBlTDtlqO3yQ YjrX7frCpeezrE2vWuln+TcHfFtOiZcACjxIoSmc8j0NXl5yXa3rnF1c6mMGM5uLsCA+1OscEuBFf BFMkc9PDwm2Q9vDkI4whL88rY39yGgFqyOTno1lf1J6nN7ZTJJbFE+F40oVJtUOtoorVW9z+bXl6c YYRn8MhiyheKxTxh9x/W+w==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBrjh-0000Jl-Ax; Sun, 01 Jan 2023 01:22:21 -0500 Date: Sun, 01 Jan 2023 08:22:24 +0200 Message-Id: <83edse4vvj.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: <1A0CC058-2A6C-47D6-8339-D522B8854E16@gmail.com> (message from Yuan Fu on Sat, 31 Dec 2022 14:11:03 -0800) Subject: Re: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. References: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> <838rio5b2b.fsf@gnu.org> <44090371-BC18-4F3C-AC59-D9B34E1CE42E@gmail.com> <1A0CC058-2A6C-47D6-8339-D522B8854E16@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60427 Cc: acm@muc.de, 60427@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Yuan Fu > Date: Sat, 31 Dec 2022 14:11:03 -0800 > Cc: Eli Zaretskii , > 60427@debbugs.gnu.org > > As Eli observed, this seems like a mismatch between the C++ language grammar you used and the queries used by c++-ts-mode. We need to pin down or declare the version of the language grammar a major mode is written on. Maybe in NEWS file? I just asked what version of the grammar and library Alan uses. If we know which version is required. can we devise a test for it? Then we could run that test when the language grammar is first loaded, and reject versions that are not suitable. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 01 01:26:31 2023 Received: (at 60427) by debbugs.gnu.org; 1 Jan 2023 06:26:31 +0000 Received: from localhost ([127.0.0.1]:40192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBrnj-000636-Am for submit@debbugs.gnu.org; Sun, 01 Jan 2023 01:26:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBrng-00062s-T8 for 60427@debbugs.gnu.org; Sun, 01 Jan 2023 01:26:29 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBrnY-0003bz-US; Sun, 01 Jan 2023 01:26:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=6k3FktyBw4Od1cOa50DNBDqVcgi6OlzDXBx1NyYiCms=; b=mQ2jInW+LT4SIb5L11pq qTZqBoC93bG46bW3fhzE6X9P9dRw49pYUqU1f+aXq6Af8HQhSqCq01A6rzrZJjbryX+/mFXBlmeYr IDz2dZ/a4DwzUU6C0KLU1dqchDPw7aIJ/c9YB8VMUohIc4rC8q0GXO4bv4UYqvFaZ7OTXsNDjGDye 1J5pJX6mN59zPGBgHROd5sJ+FDD1BJ9f0u+WgGJ334xpluMSvi2CkcFxOTQShy4edp6oGZK/+0nFP 58T7ASKJ0vm/Ny+eVYea36ofCT3+S3Ws5RWWU55gtSRnPeqNEMl/A++gjjXb6VDkBdSxY8ETnKWNu 7xXP9F2CwNJNHg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBrnX-0000dc-P2; Sun, 01 Jan 2023 01:26:20 -0500 Date: Sun, 01 Jan 2023 08:26:23 +0200 Message-Id: <83cz7y4vow.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: <37847B53-26C1-4B7A-9042-CA74EA239427@gmail.com> (message from Yuan Fu on Sat, 31 Dec 2022 14:06:20 -0800) Subject: Re: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. References: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> <838rio5b2b.fsf@gnu.org> <44090371-BC18-4F3C-AC59-D9B34E1CE42E@gmail.com> <83pmbz4yui.fsf@gnu.org> <37847B53-26C1-4B7A-9042-CA74EA239427@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60427 Cc: acm@muc.de, 60427@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Yuan Fu > Date: Sat, 31 Dec 2022 14:06:20 -0800 > Cc: Alan Mackenzie , > 60427@debbugs.gnu.org > > > On Dec 31, 2022, at 3:05 AM, Eli Zaretskii wrote: > > > >> Date: Sat, 31 Dec 2022 10:29:21 +0000 > >> Cc: Eli Zaretskii , 60427@debbugs.gnu.org, acm@muc.de > >> From: Alan Mackenzie > >> > >> 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 01 14:31:38 2023 Received: (at 60427) by debbugs.gnu.org; 1 Jan 2023 19:31:38 +0000 Received: from localhost ([127.0.0.1]:41782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC43W-0007Fe-Fe for submit@debbugs.gnu.org; Sun, 01 Jan 2023 14:31:38 -0500 Received: from mx3.muc.de ([193.149.48.5]:59683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC43R-0007FM-QY for 60427@debbugs.gnu.org; Sun, 01 Jan 2023 14:31:37 -0500 Received: (qmail 18469 invoked by uid 3782); 1 Jan 2023 20:31:27 +0100 Received: from acm.muc.de (p4fe15c18.dip0.t-ipconnect.de [79.225.92.24]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 01 Jan 2023 20:31:27 +0100 Received: (qmail 10788 invoked by uid 1000); 1 Jan 2023 19:31:26 -0000 Date: Sun, 1 Jan 2023 19:31:26 +0000 To: Eli Zaretskii Subject: Re: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. Message-ID: References: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> <838rio5b2b.fsf@gnu.org> <44090371-BC18-4F3C-AC59-D9B34E1CE42E@gmail.com> <83r0wf4z0d.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83r0wf4z0d.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60427 Cc: acm@muc.de, casouri@gmail.com, 60427@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Sat, Dec 31, 2022 at 13:02:26 +0200, Eli Zaretskii wrote: > > Date: Sat, 31 Dec 2022 10:29:21 +0000 > > Cc: Eli Zaretskii , 60427@debbugs.gnu.org, acm@muc.de > > From: Alan Mackenzie > > I've just downloaded the latest commits in the emacs-29 branch, > > bootstrapped, and I still see the problem, both in X GUI and on a Linux > > console. Just as a matter of interest, I get the error after typing the > > h in "char", so the problem would appear not to be related to the > > specific character string "char". > I cannot reproduce this with the current emacs-29 branch, neither with > native-compilation nor without it. I also tried in a -nw session, and > couldn't reproduce there as well. > How did you get and build the C++ grammar file for tree-sitter? If > you cloned their repository, what is the last commit from which you > produced the shared library file? I installed it using my GNU/Linux distribution's package manager. That's Gentoo. > And which version of the tree-sitter library are you using? I've got tree-sitter-cpp 0.20.0. In /usr/lib64, I get: /usr/lib64/libtree-sitter-cpp.so -> libtree-sitter-cpp.so.13 > Finally, is the recipe you posted complete? are you sure you did > nothing else since starting Emacs? Yes, it's complete. I just tried following my own recipe exactly, and it produced the unwanted results described. The feeling at the moment is that that libtree-sitter-cpp.so.13 isn't compatible with Emacs 29. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 01 15:20:08 2023 Received: (at 60427) by debbugs.gnu.org; 1 Jan 2023 20:20:08 +0000 Received: from localhost ([127.0.0.1]:41823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC4oS-00009S-8a for submit@debbugs.gnu.org; Sun, 01 Jan 2023 15:20:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC4oP-00008k-Nr for 60427@debbugs.gnu.org; Sun, 01 Jan 2023 15:20:07 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pC4oK-0000Wl-4u; Sun, 01 Jan 2023 15:20:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=j5A4UDoYClT1nPmaQv1eYPWlZaNU9lXXJv+MAZJb8Ig=; b=IVUdTFR62iTl NYbPdwkwS04efrmCyzYL4S3R4u04PSEIN9x7s7WhrMFAMB8pjMULnXBpvG+0VqbNtWyseXt3V6Csl lweIMsV3fI3+PGQcEBimi5c8Wg0JfiglI3jJN4iAA+cBpFnJff1+wT5hebzN+VKYI9OlLypcROCyC DCGm/dDZE2S79LblFdkvGlH8mr8ChKvHE8yedAbvm+ZqJLWUU063cPAo3ayUsE0zb18VzuDoSD2aA bKtOuKTTkwB6AN62lvnC8RduGCAoxGRRc4XMCBYbKa5L+j7hRsMHKvWbBYSbs8xcm+Tr5tvBO53T5 Sfa3l0CTP0ylcindQoTrMw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pC4oJ-0002gz-G1; Sun, 01 Jan 2023 15:19:59 -0500 Date: Sun, 01 Jan 2023 22:20:05 +0200 Message-Id: <83h6xa2eiy.fsf@gnu.org> From: Eli Zaretskii To: Alan Mackenzie In-Reply-To: (message from Alan Mackenzie on Sun, 1 Jan 2023 19:31:26 +0000) Subject: Re: bug#60427: Emacs-29, c++-ts-mode: typing "char" into an empty buffer causes an exception in redisplay. References: <5B1D377B-63DE-43F9-A0AE-27B06AAF24AA@gmail.com> <838rio5b2b.fsf@gnu.org> <44090371-BC18-4F3C-AC59-D9B34E1CE42E@gmail.com> <83r0wf4z0d.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60427 Cc: casouri@gmail.com, 60427@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 1 Jan 2023 19:31:26 +0000 > Cc: casouri@gmail.com, 60427@debbugs.gnu.org, acm@muc.de > From: Alan Mackenzie > > > How did you get and build the C++ grammar file for tree-sitter? If > > you cloned their repository, what is the last commit from which you > > produced the shared library file? > > I installed it using my GNU/Linux distribution's package manager. > That's Gentoo. > > > And which version of the tree-sitter library are you using? > > I've got tree-sitter-cpp 0.20.0. In /usr/lib64, I get: > > /usr/lib64/libtree-sitter-cpp.so -> libtree-sitter-cpp.so.13 That's more than a year ago (Oct 2021), if my reading of their Git logs is correct. Please try a newer version, perhaps from their Git repository, if you can. > The feeling at the moment is that that libtree-sitter-cpp.so.13 isn't > compatible with Emacs 29. Could be. But we won't know for sure until you try a newer version of the grammar library.