GNU bug report logs - #67977
30.0.50; tree-sitter: Emacs crashes when accessing treesit-nodes in a narrowed buffer

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Denis Zubarev <dvzubarev@HIDDEN>; Done: Yuan Fu <casouri@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 30.1, send any further explanations to 67977 <at> debbugs.gnu.org and Denis Zubarev <dvzubarev@HIDDEN> Request was from Yuan Fu <casouri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 2 Jan 2024 22:58:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 02 17:58:40 2024
Received: from localhost ([127.0.0.1]:51549 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rKniZ-0007Ma-N7
	for submit <at> debbugs.gnu.org; Tue, 02 Jan 2024 17:58:39 -0500
Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:51613)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1rKniU-0007MJ-1I
 for 67977 <at> debbugs.gnu.org; Tue, 02 Jan 2024 17:58:38 -0500
Received: by mail-ot1-x332.google.com with SMTP id
 46e09a7af769-6dc049c7b58so3599047a34.3
 for <67977 <at> debbugs.gnu.org>; Tue, 02 Jan 2024 14:58:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1704236305; x=1704841105; darn=debbugs.gnu.org;
 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=+WPyuBMnF+d7vSmJe3aiPQB13azrk0LvPyhb5oUDkDU=;
 b=m3p3olitdDbVUr16NVGxIMMjbiVlpqaJgcMESW17f3PSs7hl1Js2fBqwcB2Ojs2ODe
 w1cjPRZFr+vuhDUD0hZvdr9ZWpcBbHeFtMpbjwljl/Oah+IXGbIfYi6Fccm5It6lKjHk
 M2ZhdmDt+vfQ5zYOWMUrFS6SoMqzZ/TW5Of65nerN3BhSB+W+eH73qRPMLx9gNa9Yz3o
 AlWxsgRWHaa14iPKnVbP5S8FWtt5TDt7W2GLP3DGlZiRwmw8S6AtKvTphLfdciawfyYF
 W7X0OEl0QN91WllzEG76i8cZWyVdH7BHOhsrNhX8qbjjuONnjbJ2c9C8u3ME7WC4AtKv
 UMqQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1704236305; x=1704841105;
 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=+WPyuBMnF+d7vSmJe3aiPQB13azrk0LvPyhb5oUDkDU=;
 b=BZnMdPqniTevArqlu6G9j3H5w2Xt6QiZ0h9Bt5dfvuhk8jXHb6iKXXMyO6Lm5kIzdl
 eZgsj2OeJyraf0/704iecsYunwCOpD795T/L6U/hFox2sF2Ny+1TEgha5xC+UcdYCWag
 7YHpb7b6Qexx4TxFBjPf374jJJ81kz/GrTnPYHNfFDbmug+UPN/sSkjrk8qjrZ3Y6KYb
 VSdHibjZzYgSnknq5uSYNwLYK97ipDzHIVrWOP2KpzuqKnp7jfQdu6ESBQR0Clw23ACx
 Klzg9DdpeppZ3BZSylzFJLf/OQg15CUuq6BdHc5wBai874xU2VvWii2TaP8uuEAbjbrX
 y9Lg==
X-Gm-Message-State: AOJu0YznV++/Hu/WtpNeb/twkdNAH5wUnNlCclIq97Dqt+6NMKlQRpA9
 X0sbAW9nnu3IP4K7XFpWk2Y=
X-Google-Smtp-Source: AGHT+IHTmajVE2jZZS7f0AHqHd8TlthbglTdFJPoHvbEFziT3u+yz5+YY3f72xmChIIX5D1oqMx6Ng==
X-Received: by 2002:a9d:5d06:0:b0:6dc:7d3c:91e5 with SMTP id
 b6-20020a9d5d06000000b006dc7d3c91e5mr210137oti.26.1704236305580; 
 Tue, 02 Jan 2024 14:58:25 -0800 (PST)
Received: from smtpclient.apple (172-117-161-177.res.spectrum.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 21-20020a631355000000b005cda7a1d72dsm20840681pgt.74.2024.01.02.14.58.24
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 02 Jan 2024 14:58:25 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\))
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <8702f943-54c4-47ee-b9eb-c9540ed4043a@HIDDEN>
Date: Tue, 2 Jan 2024 14:58:13 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <EF14BD55-5FBF-4EB0-93C9-B1BD5F73385E@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN>
 <2141703952885@HIDDEN>
 <B100D4A5-F0ED-429F-B62C-9B052B5505E5@HIDDEN>
 <10451704018554@HIDDEN>
 <ce452e6f-417c-4e00-8f92-b4bb019e9fb0@HIDDEN>
 <jwv34vg4a98.fsf-monnier+emacs@HIDDEN>
 <8702f943-54c4-47ee-b9eb-c9540ed4043a@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
X-Mailer: Apple Mail (2.3731.700.6)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67977
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>,
 Denis Zubarev <dvzubarev@HIDDEN>,
 "67977 <at> debbugs.gnu.org" <67977 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


> Though might be that the signaled args-out-of-range will be a reliable =
indicator of this situation anyway.

Right. The signal is pretty clear on what=E2=80=99s wrong.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 2 Jan 2024 13:34:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 02 08:34:51 2024
Received: from localhost ([127.0.0.1]:49626 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rKeux-0005Qv-Iq
	for submit <at> debbugs.gnu.org; Tue, 02 Jan 2024 08:34:51 -0500
Received: from out3-smtp.messagingengine.com ([66.111.4.27]:33385)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1rKeut-0005Qf-P1
 for 67977 <at> debbugs.gnu.org; Tue, 02 Jan 2024 08:34:49 -0500
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailout.nyi.internal (Postfix) with ESMTP id 905CD5C01AF;
 Tue,  2 Jan 2024 08:34:39 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute6.internal (MEProxy); Tue, 02 Jan 2024 08:34:39 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm1; t=1704202479;
 x=1704288879; bh=7kdmLcC/pf8LflH5clmKgTazihppNB0cYSUVjv4LerQ=; b=
 DubD9kWniN+pglffsw52TIYEsVH6rgjo/ddnAFVNW2Lv+YFvqPjiVQhYmR0K8Yi3
 cuYodq+qJPZiJRLa1dVttokwvoS5OFyYatTQrugSthIVfIlrS5ZisFhpP2/jnrAq
 FApIqOM3Ee7YboPSRwYJKT7XWK8D5csjvLsC9fl9fqKqomOv373tqmjhFDf8+azv
 GEgZoMv+npkAoSP6WHILDnBsa9rejs1J0FP8PPQesnV2HsWlOdPcgc2X48Z69WIL
 TKVboH4iIV5/+LnNUQxspYZQohZJlhh5u/RZraWZz2aptz5qnuy/78r0vi7PE7iA
 gPid8vzRUdt6G5hI8Fh3Qg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1704202479; x=
 1704288879; bh=7kdmLcC/pf8LflH5clmKgTazihppNB0cYSUVjv4LerQ=; b=L
 gVxtkZxX/SgL2KyhPPqa85u5YfKxLOZZIliqI02cDod7n2VMh3a3TmwR8NViM7ML
 lRq+y5nAMzJuT+diCcUjTP02ExAt7/2qnzb3OSY7NuU1TbrGraV1PZkQ7/ZTfZzM
 ceBrfAN4E9+9H4HnKFxkS9wiWX6mKrHchlZFn2j81kPqyUHhbu+5Onc6vz7OudJM
 2b/imH+9wKVpRfKRtI82aNzp8aaqK4FSDju04dZf4nLFRlIi4LacrRY9FWCVcxDe
 PVexc+owmgJeS1+v+o2uEafktDmEAP4Ibgoq4mMfAAk3G8COzlizhWt7UPn7kE9K
 JJrlXuqfFrwoJpHE7e1sA==
X-ME-Sender: <xms:7xCUZaiyZNtAejnMkD7GqBeWdF0ueBJvSYwlou2AWEZDCRGVkCPReQ>
 <xme:7xCUZbAdOY0i2-TUxhqf00q_n6KPkEVJ8DCpSDimkBs7MvB3uvmz3kCY8P4o4ZoXR
 JYo2APhJeLWHhTfFTQ>
X-ME-Received: <xmr:7xCUZSEcnmcOQWApddiRzBYSJrMuGe2f2fCGxlxtH0m7R0b2X1qOdbp5BZUe41Vq1bMbCw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegvddghedvucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu
 jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:7xCUZTQM5_wK3WXSKZ9aLJc4NzCBo_r1kdOdFOQ3SofUQ8O_jtpLMg>
 <xmx:7xCUZXyuiteLIR5qUqVH_fYJgQ_VGWq5NkQmzC3a9Myg_rv2kn3ngA>
 <xmx:7xCUZR5PBkJSrmQFnpdVm-WaRtnarcN4-YtCXWpSs_CLe6budcISpA>
 <xmx:7xCUZX868mSm8Ms6ejAvgRg8mJpAbnVlwKzXYQ2Qdl9HoI0li8UkDw>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 2 Jan 2024 08:34:37 -0500 (EST)
Message-ID: <8702f943-54c4-47ee-b9eb-c9540ed4043a@HIDDEN>
Date: Tue, 2 Jan 2024 15:34:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
Content-Language: en-US
To: Stefan Monnier <monnier@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN>
 <2141703952885@HIDDEN>
 <B100D4A5-F0ED-429F-B62C-9B052B5505E5@HIDDEN>
 <10451704018554@HIDDEN>
 <ce452e6f-417c-4e00-8f92-b4bb019e9fb0@HIDDEN>
 <jwv34vg4a98.fsf-monnier+emacs@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <jwv34vg4a98.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 67977
Cc: Yuan Fu <casouri@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 Denis Zubarev <dvzubarev@HIDDEN>,
 "67977 <at> debbugs.gnu.org" <67977 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 02/01/2024 06:46, Stefan Monnier wrote:
>> diff --git a/lisp/treesit.el b/lisp/treesit.el
>> index 264b95dc3a3..46ebadcf057 100644
>> --- a/lisp/treesit.el
>> +++ b/lisp/treesit.el
>> @@ -1150,7 +1150,7 @@ treesit--pre-syntax-ppss
>>       (if (and new-start (< new-start start))
>>           (progn
>>             (setq treesit--syntax-propertize-start nil)
>> -          (cons new-start end))
>> +          (cons (max new-start (point-min)) end))
>>         nil)))
>>
>>   ;;; Indent
> Sounds fine to me.  Often the caller of `syntax-propertize-function`
> should widen beforehand, but in cases like `mmm-mode` indeed that's not
> always desired.

Thank you, I've pushed that fix.

>> Or maybe syntax-propertize itself should have a protection against going
>> outside of bounds:
>>
>> diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
>> index e35992298a6..61a9e79b59c 100644
>> --- a/lisp/emacs-lisp/syntax.el
>> +++ b/lisp/emacs-lisp/syntax.el
>> @@ -431,7 +431,7 @@ syntax-propertize
>>                        (if (or (null new)
>>                                (and (>= (car new) start) (<= (cdr new) end)))
>>                            nil
>> -                       (setq start (car new))
>> +                       (setq start (max (car new) (point-min)))
>>                          (setq end (cdr new))
>>                          ;; If there's been a change, we should go through
>>                            the
>>                          ;; list again since this new position may
> I think it's preferable for the expand-region function to perform this
> test.  We could `cl-assert` that it's within BOB...EOB to help catch
> such bugs (and clarify who's in charge of avoiding the problem), but
> maybe we can mention it in the docstring.  But I personally consider
> that anything that sends buffer positions is in charge to make sure that
> they're within bounds, unless specifically documented otherwise, so
> documenting it seems redundant.

Fair enough.

And I'll leave the question of adding cl-assert (or not) to you or 
others. Though might be that the signaled args-out-of-range will be a 
reliable indicator of this situation anyway.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 2 Jan 2024 04:47:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 01 23:47:04 2024
Received: from localhost ([127.0.0.1]:49183 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rKWgC-0001bP-Iz
	for submit <at> debbugs.gnu.org; Mon, 01 Jan 2024 23:47:04 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:17396)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rKWgA-0001av-N5
 for 67977 <at> debbugs.gnu.org; Mon, 01 Jan 2024 23:47:03 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id F1F71441872;
 Mon,  1 Jan 2024 23:46:54 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1704170813;
 bh=2qt4OSuR01cIhPLaBd0svGTBNrFXEugg6lFkTaVdXHY=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=YprNmej6aGX+CMyM12g1eMMBUhXueIFNvbJnRmT+pc4hSVk/vNEE1XvO1UroyV/pZ
 2bOKm5AVl0glJll7sdXXci9OAAWBTA02XtqdXPVPrMiuV/3+rdTkgopWUmKEqpxNT6
 qwu7Cr7qzy/a4aSxyAfGCPXiJLY/yece9RumYDcRJ65VoaxnuB9jL9pdfAKpqqq625
 n05SBBtF8gHmfKBavEZXM4KYRv16NGChRNb4Sk5OP0krJG6r2+2WYRRIMddwl7wD8q
 j53yJ18ateupVff62dhp4LXj9yqIzdIaRXjOYQyW4B5fyJ1iI+REZiZrgyZMlx6yNj
 VmgP4qGGvrl+Q==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8F93144185F;
 Mon,  1 Jan 2024 23:46:53 -0500 (EST)
Received: from alfajor (unknown [207.96.224.130])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6BE45121186;
 Mon,  1 Jan 2024 23:46:53 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
In-Reply-To: <ce452e6f-417c-4e00-8f92-b4bb019e9fb0@HIDDEN> (Dmitry Gutov's
 message of "Sun, 31 Dec 2023 15:40:28 +0200")
Message-ID: <jwv34vg4a98.fsf-monnier+emacs@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN>
 <2141703952885@HIDDEN>
 <B100D4A5-F0ED-429F-B62C-9B052B5505E5@HIDDEN>
 <10451704018554@HIDDEN>
 <ce452e6f-417c-4e00-8f92-b4bb019e9fb0@HIDDEN>
Date: Mon, 01 Jan 2024 23:46:52 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 67977
Cc: Yuan Fu <casouri@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 Denis Zubarev <dvzubarev@HIDDEN>,
 "67977 <at> debbugs.gnu.org" <67977 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> diff --git a/lisp/treesit.el b/lisp/treesit.el
> index 264b95dc3a3..46ebadcf057 100644
> --- a/lisp/treesit.el
> +++ b/lisp/treesit.el
> @@ -1150,7 +1150,7 @@ treesit--pre-syntax-ppss
>      (if (and new-start (< new-start start))
>          (progn
>            (setq treesit--syntax-propertize-start nil)
> -          (cons new-start end))
> +          (cons (max new-start (point-min)) end))
>        nil)))
>
>  ;;; Indent

Sounds fine to me.  Often the caller of `syntax-propertize-function`
should widen beforehand, but in cases like `mmm-mode` indeed that's not
always desired.

> Or maybe syntax-propertize itself should have a protection against going
> outside of bounds:
>
> diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
> index e35992298a6..61a9e79b59c 100644
> --- a/lisp/emacs-lisp/syntax.el
> +++ b/lisp/emacs-lisp/syntax.el
> @@ -431,7 +431,7 @@ syntax-propertize
>                       (if (or (null new)
>                               (and (>= (car new) start) (<= (cdr new) end)))
>                           nil
> -                       (setq start (car new))
> +                       (setq start (max (car new) (point-min)))
>                         (setq end (cdr new))
>                         ;; If there's been a change, we should go through
>                           the
>                         ;; list again since this new position may

I think it's preferable for the expand-region function to perform this
test.  We could `cl-assert` that it's within BOB...EOB to help catch
such bugs (and clarify who's in charge of avoiding the problem), but
maybe we can mention it in the docstring.  But I personally consider
that anything that sends buffer positions is in charge to make sure that
they're within bounds, unless specifically documented otherwise, so
documenting it seems redundant.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 31 Dec 2023 13:40:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 31 08:40:41 2023
Received: from localhost ([127.0.0.1]:45835 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rJw3V-00038t-2J
	for submit <at> debbugs.gnu.org; Sun, 31 Dec 2023 08:40:41 -0500
Received: from out3-smtp.messagingengine.com ([66.111.4.27]:56389)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1rJw3T-00038g-Mf
 for 67977 <at> debbugs.gnu.org; Sun, 31 Dec 2023 08:40:40 -0500
Received: from compute2.internal (compute2.nyi.internal [10.202.2.46])
 by mailout.nyi.internal (Postfix) with ESMTP id 57DBB5C00CF;
 Sun, 31 Dec 2023 08:40:33 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute2.internal (MEProxy); Sun, 31 Dec 2023 08:40:33 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm1; t=1704030033;
 x=1704116433; bh=26dZOkjYUrLNAIabDdBcR/E6DHbnKxAMxPKYQGAt+3Y=; b=
 kdqfWDMeMVrOEhDTSTOCHXXHdnQs7gRFCZPAkX9U3Fcf0ORYFJNQHdUq+0JlNck+
 J6WtGLZVVxQNYJLFVQgX0LXM9LMvwShHJAWGVSNyhLPKZpMTODezDEbEsnaJYtkj
 +FEUawSihzMUp49IpIx6P4hm81xztsSYrlQhFxh/OFXFLPbzTSoUZ/3Xkr83jim0
 MZMvza+035HX3z11DVKpQP9/8dhh2YMPFiIEeFbhaM0Mzo5dNTH9fZz4sxw+RIm8
 hPIXzMgXEHVHAaYaZilbHmMHYn6OufB8KPPYoJDVMgFs5edKRWC14yrxOZcKlKeU
 sUWRWZx/R/fbxfa+5bJdKg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1704030033; x=
 1704116433; bh=26dZOkjYUrLNAIabDdBcR/E6DHbnKxAMxPKYQGAt+3Y=; b=q
 ZsTt6WgBRwnoJJHJ6JfcfELGQ3hOssXHrnldd0P3ER4byyZfoa+/y1IAs8fmaMRT
 4IVggs9FstKY8y8YYVDAtBSJ6nj7S37tvCl62nscIJ01VvIbJf1K43Mf/Llhtk+G
 7/1dKRgJLqjEpZOZoEizXb7SP+5QIVO1ckSf2hq8dFvtQkLe1LSj81EVmq/lFYwS
 XUxy6k6ujO/DgeeoGkbbq/c3hJ/o0rbqVS2LNbP1e4x6ohLRUmOqNdRKeKnSZahg
 t1iL9B9y+fPJjJLO5/OIYMIasWoztU1iE84DCdX8VEliNQWR7Osxbn/BlNkQzTbY
 PgKszdNIsUSnu8lLlto9Q==
X-ME-Sender: <xms:UG-RZbzKHDc9oaQt6nEPWY_TuCArwULo_Nrn7HrePcoWdNAoiOgBCQ>
 <xme:UG-RZTRWrYoUN05-YrH69-xqlbVeS29g7DuJ73u-TfcR5Of_F9rPIgf-1Qd9atLno
 WMYhiSDLG7a7iYpv3k>
X-ME-Received: <xmr:UG-RZVXEkE4nV2EBruHQ8FoCR2XZO19HO5CXUdIoiIpGnZ1pZb4ByAAXvQly-RqHwrVX-A>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdefkedgfedvucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu
 jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:UG-RZVhiR309gTEOk_xpwj14nj18d5GTp6aS0c-zt9lYP2tc9BLn4g>
 <xmx:UG-RZdCzI697Z9HOcaaHnz6q-AHuwIAUJR7kAHqatcvZxGeF7FiZfg>
 <xmx:UG-RZeILZ0qh1P5z6k-2ckCejs02FYmA0RbeYKyx6fmAt6ajuHpWbw>
 <xmx:UW-RZcNL_JLH7E5Th7oEB7VQu1TKhlr8AqB0Ex6LW6TGdQ9NKu8R0A>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 31 Dec 2023 08:40:31 -0500 (EST)
Message-ID: <ce452e6f-417c-4e00-8f92-b4bb019e9fb0@HIDDEN>
Date: Sun, 31 Dec 2023 15:40:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
Content-Language: en-US
To: Denis Zubarev <dvzubarev@HIDDEN>, Yuan Fu <casouri@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN>
 <2141703952885@HIDDEN>
 <B100D4A5-F0ED-429F-B62C-9B052B5505E5@HIDDEN>
 <10451704018554@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <10451704018554@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 67977
Cc: Eli Zaretskii <eliz@HIDDEN>,
 "67977 <at> debbugs.gnu.org" <67977 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 31/12/2023 12:39, Denis Zubarev wrote:
> Also there were errors when running benchmark in the narrowed buffer:
> Error muted by safe_call: (internal--syntax-propertize 1482) signaled 
> (args-out-of-range 1 1872)

That does look like a bug.

The patch below seems to fix it:

diff --git a/lisp/treesit.el b/lisp/treesit.el
index 264b95dc3a3..46ebadcf057 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1150,7 +1150,7 @@ treesit--pre-syntax-ppss
      (if (and new-start (< new-start start))
          (progn
            (setq treesit--syntax-propertize-start nil)
-          (cons new-start end))
+          (cons (max new-start (point-min)) end))
        nil)))

  ;;; Indent


Or maybe syntax-propertize itself should have a protection against going 
outside of bounds:

diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
index e35992298a6..61a9e79b59c 100644
--- a/lisp/emacs-lisp/syntax.el
+++ b/lisp/emacs-lisp/syntax.el
@@ -431,7 +431,7 @@ syntax-propertize
                       (if (or (null new)
                               (and (>= (car new) start) (<= (cdr new) 
end)))
                           nil
-                       (setq start (car new))
+                       (setq start (max (car new) (point-min)))
                         (setq end (cdr new))
                         ;; If there's been a change, we should go 
through the
                         ;; list again since this new position may





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 31 Dec 2023 12:56:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 31 07:56:42 2023
Received: from localhost ([127.0.0.1]:45782 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rJvMw-0002gY-Fz
	for submit <at> debbugs.gnu.org; Sun, 31 Dec 2023 07:56:42 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:56200)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rJvMu-0002gL-5Z
 for 67977 <at> debbugs.gnu.org; Sun, 31 Dec 2023 07:56:40 -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 <eliz@HIDDEN>)
 id 1rJvMn-00088Q-9N; Sun, 31 Dec 2023 07:56:33 -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=JC+szpYu7uooWdArVCvsO6a23RmIurnTpTn5SaQNlbo=; b=SKVL2sOSfiIs
 IQ+E563rWfyAeHFictMdlBdCZZfmNjMuDAjxCxgghv2SDU6EgZyaZBknRmNGL00qcXojpgHO55sGK
 X58bneet37rnc4lHkiQ3tSxV3LRAGJfHUcvA/bJzvstJpcdSN+Ijl2dniyyRFa9xpj8v1sYpJj6hC
 q6Y06c8LRa/zn5q16UWhtffV5cMk4YAEcTX8ReVXyuPBVMU1cH2vJM1yBN4mVcaKRJ7JhgOffXyIR
 7BnfTAKgqDlUxZWrv0m+1Xn+Lp1EVoOP7888CuiD98HFI1J5Lrr42BBAzeUJBtkElLa18XqCT/Waq
 3YBQRACjFqPkM9ild7obtA==;
Date: Sun, 31 Dec 2023 14:56:25 +0200
Message-Id: <838r5a34zq.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Denis Zubarev <dvzubarev@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <10451704018554@HIDDEN> (message from Denis Zubarev on
 Sun, 31 Dec 2023 13:39:10 +0300)
Subject: Re: bug#67977: 30.0.50;
 tree-sitter: Emacs crashes when accessing treesit-nodes in a narrowed
 buffer
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN>
 <2141703952885@HIDDEN>
 <B100D4A5-F0ED-429F-B62C-9B052B5505E5@HIDDEN>
 <10451704018554@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 67977
Cc: casouri@HIDDEN, 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Denis Zubarev <dvzubarev@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,
> 	"67977 <at> debbugs.gnu.org" <67977 <at> debbugs.gnu.org>
> Date: Sun, 31 Dec 2023 13:39:10 +0300
> 
> Yes, if accessing nodes, then there is a slowdown.
>  
> The result is what benchmark-run returns.
>  
>  # func  buff-size  widen                 narrowed                
> ------------------------------------------------------------------
>       1  671 B      (0.22944 2 0.022735)  (0.520645 9 0.1100442)  
>      11  7 KiB      (0.23176 3 0.038288)  (0.9340281 9 0.116293   
>      31  20 KiB     (0.27746 3 0.039054)  (1.7671007 10 0.134515)
>  
> Also there were errors when running benchmark in the narrowed buffer:
> Error muted by safe_call: (internal--syntax-propertize 1482) signaled (args-out-of-range 1 1872)
> Error muted by safe_call: (internal--syntax-propertize 282) signaled (args-out-of-range 1 672)
> 
>  
> Recipe:
> 1. emacs -Q
> 2. paste the code to the buffer
> 3. M-x python-ts-mode
> 4. put the cursor in the place of |
>  
> 5. M-x eval-expression
>    (require 'benchmark)
>    (benchmark-run 200 (progn (insert "v")  (insert "=") (insert "f") (insert "(") (insert ")") (treesit-node-at
> (point)) (insert "\n") (font-lock-ensure) ))
> 6. M-x undo
>  
> For benchmark in narrowed state select the body of a function, starting from a documentation string
> and M-x narrow-to-region.
>  
> To increase buffer size copy the whole function:
> M-x eval-expression
> (dotimes (_ 10) (yank))
> 
>  
> Code:
> class TempC:
>     def func_call():
>         """documentation
>         """
>         var1 = 3
>         var2 = func(1, temp={'1':1, '2':2},
>                     temp1=TempC([1], [3]), ab='83, 8',)
>         var3= r'\n str'
>         var4 = f'temp {TempC("1"+"3")}|{v + "mon" +v}and {func()}'
>  
>         |
>  
>         varb =832
>         if varb:
>             pass
>         elif not varb is not None and varb == 3:
>             varb = 38
>         else:
>             pass
>  
>         for i in range():
>             print(i)
>  
>         def nested():
>             class Nested(Tempc):
>                 def __init__(self):
>                     self._init = True
>             return Nested()
>         return nested

Adding Stefan to the discussion.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 31 Dec 2023 10:39:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 31 05:39:19 2023
Received: from localhost ([127.0.0.1]:45664 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rJtDz-0000B6-8s
	for submit <at> debbugs.gnu.org; Sun, 31 Dec 2023 05:39:19 -0500
Received: from forward502a.mail.yandex.net ([178.154.239.82]:33380)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dvzubarev@HIDDEN>) id 1rJtDv-0000Au-MD
 for 67977 <at> debbugs.gnu.org; Sun, 31 Dec 2023 05:39:17 -0500
Received: from mail-nwsmtp-mxback-production-main-674.vla.yp-c.yandex.net
 (mail-nwsmtp-mxback-production-main-674.vla.yp-c.yandex.net
 [IPv6:2a02:6b8:c1f:169a:0:640:b2fa:0])
 by forward502a.mail.yandex.net (Yandex) with ESMTP id 264C460CE5;
 Sun, 31 Dec 2023 13:39:12 +0300 (MSK)
Received: from mail.yandex.ru (2a02:6b8:c29:f948:0:640:4f2b:0
 [2a02:6b8:c29:f948:0:640:4f2b:0])
 by mail-nwsmtp-mxback-production-main-674.vla.yp-c.yandex.net (mxback/Yandex)
 with HTTP id XcVsW1SOuSw0-J2khZMw4; Sun, 31 Dec 2023 13:39:11 +0300
X-Yandex-Fwd: 1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
 t=1704019151; bh=sYHA0KbaD0tgOmxR8HIGlsf/zSB6h/CrH41uTHSiJww=;
 h=Message-Id:References:Date:Cc:Subject:To:From;
 b=w9AjC9gexfcpeJd3az1Kpj/KG1aDpw3v3R8BbbyFPdfp9T0D8p8jjXI3SnhqSeHN0
 tlooG3Y08Fal/hi58GY3e50OZE4d0rVp/XP1mEmeoIPkIIYiF8lzHy8tH90xx/6jmB
 DDsvGWnbgvzpOLIZvFVIE0kGE69Vc2rRqGbE5E3Y=
Authentication-Results: mail-nwsmtp-mxback-production-main-674.vla.yp-c.yandex.net;
 dkim=pass header.i=@yandex.ru
Received: by gkcrf2nurtnzrdvs.vla.yp-c.yandex.net with HTTP;
 Sun, 31 Dec 2023 13:39:10 +0300
From: Denis Zubarev <dvzubarev@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN>
 <2141703952885@HIDDEN>
 <B100D4A5-F0ED-429F-B62C-9B052B5505E5@HIDDEN>
Subject: Re: bug#67977: 30.0.50;
 tree-sitter: Emacs crashes when accessing treesit-nodes in a narrowed
 buffer
MIME-Version: 1.0
X-Mailer: Yamail [ http://yandex.ru ] 5.0
Date: Sun, 31 Dec 2023 13:39:10 +0300
Message-Id: <10451704018554@HIDDEN>
Content-Transfer-Encoding: base64
Content-Type: text/html; charset=utf-8
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 67977
Cc: Eli Zaretskii <eliz@HIDDEN>,
 "67977 <at> debbugs.gnu.org" <67977 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

PGRpdj5ZZXMsIGlmIGFjY2Vzc2luZyBub2RlcywgdGhlbiB0aGVyZSBpcyBhIHNsb3dkb3duLjwv
ZGl2PjxkaXY+wqA8L2Rpdj48ZGl2PjxkaXY+PGRpdj5UaGUgcmVzdWx0IGlzIHdoYXQgYmVuY2ht
YXJrLXJ1biByZXR1cm5zLjwvZGl2PjxkaXY+wqA8L2Rpdj48ZGl2PsKgIyBmdW5jwqAgYnVmZi1z
aXplwqAgd2lkZW7CoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBuYXJyb3dlZMKgwqDC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgwqA8L2Rpdj48ZGl2Pi0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLTwvZGl2PjxkaXY+
wqDCoMKgwqDCoCAxwqAgNjcxIELCoMKgwqDCoMKgICgwLjIyOTQ0IDIgMC4wMjI3MzUpwqAgKDAu
NTIwNjQ1IDkgMC4xMTAwNDQyKSDCoDwvZGl2PjxkaXY+wqDCoMKgwqAgMTHCoCA3IEtpQsKgwqDC
oMKgwqAgKDAuMjMxNzYgMyAwLjAzODI4OCnCoCAoMC45MzQwMjgxIDkgMC4xMTYyOTPCoCDCoDwv
ZGl2PjxkaXY+wqDCoMKgwqAgMzHCoCAyMCBLaULCoMKgwqDCoCAoMC4yNzc0NiAzIDAuMDM5MDU0
KcKgICgxLjc2NzEwMDcgMTAgMC4xMzQ1MTUpPC9kaXY+PGRpdj7CoDwvZGl2PjxkaXY+PGRpdj5B
bHNvIHRoZXJlIHdlcmUgZXJyb3JzIHdoZW4gcnVubmluZyBiZW5jaG1hcmsgaW4gdGhlIG5hcnJv
d2VkIGJ1ZmZlcjo8L2Rpdj48ZGl2PkVycm9yIG11dGVkIGJ5IHNhZmVfY2FsbDogKGludGVybmFs
LS1zeW50YXgtcHJvcGVydGl6ZSAxNDgyKSBzaWduYWxlZCAoYXJncy1vdXQtb2YtcmFuZ2UgMSAx
ODcyKTwvZGl2PjxkaXY+RXJyb3IgbXV0ZWQgYnkgc2FmZV9jYWxsOiAoaW50ZXJuYWwtLXN5bnRh
eC1wcm9wZXJ0aXplIDI4Mikgc2lnbmFsZWQgKGFyZ3Mtb3V0LW9mLXJhbmdlIDEgNjcyKTwvZGl2
PjxkaXY+PGJyIC8+PC9kaXY+PC9kaXY+PGRpdj7CoDwvZGl2PjxkaXY+UmVjaXBlOjwvZGl2Pjxk
aXY+PGRpdj4xLiBlbWFjcyAtUTwvZGl2PjxkaXY+Mi4gcGFzdGUgdGhlIGNvZGUgdG8gdGhlIGJ1
ZmZlcjwvZGl2PjxkaXY+My4gTS14IHB5dGhvbi10cy1tb2RlPC9kaXY+PGRpdj40LiBwdXQgdGhl
IGN1cnNvciBpbiB0aGUgcGxhY2Ugb2YgfDwvZGl2PjxkaXY+wqA8L2Rpdj48ZGl2PjUuIE0teCBl
dmFsLWV4cHJlc3Npb248L2Rpdj48ZGl2PsKgwqAgKHJlcXVpcmUgJ2JlbmNobWFyayk8L2Rpdj48
ZGl2PsKgwqAgKGJlbmNobWFyay1ydW4gMjAwIChwcm9nbiAoaW5zZXJ0ICJ2IinCoCAoaW5zZXJ0
ICI9IikgKGluc2VydCAiZiIpIChpbnNlcnQgIigiKSAoaW5zZXJ0ICIpIikgKHRyZWVzaXQtbm9k
ZS1hdCAocG9pbnQpKSAoaW5zZXJ0ICJcbiIpIChmb250LWxvY2stZW5zdXJlKSApKTwvZGl2Pjxk
aXY+Ni4gTS14IHVuZG88L2Rpdj48ZGl2PsKgPC9kaXY+PGRpdj5Gb3IgYmVuY2htYXJrIGluIG5h
cnJvd2VkIHN0YXRlIHNlbGVjdCB0aGUgYm9keSBvZiBhIGZ1bmN0aW9uLCBzdGFydGluZyBmcm9t
IGEgZG9jdW1lbnRhdGlvbiBzdHJpbmc8L2Rpdj48ZGl2PmFuZCBNLXggbmFycm93LXRvLXJlZ2lv
bi48L2Rpdj48ZGl2PsKgPC9kaXY+PGRpdj5UbyBpbmNyZWFzZSBidWZmZXIgc2l6ZSBjb3B5IHRo
ZSB3aG9sZSBmdW5jdGlvbjo8L2Rpdj48ZGl2Pk0teCBldmFsLWV4cHJlc3Npb248L2Rpdj48ZGl2
Pihkb3RpbWVzIChfIDEwKSAoeWFuaykpPC9kaXY+PGRpdj48YnIgLz7CoDwvZGl2PjxkaXY+Q29k
ZTo8L2Rpdj48ZGl2PjxkaXY+Y2xhc3MgVGVtcEM6PC9kaXY+PGRpdj7CoMKgwqAgZGVmIGZ1bmNf
Y2FsbCgpOjwvZGl2PjxkaXY+wqDCoMKgwqDCoMKgwqAgIiIiZG9jdW1lbnRhdGlvbjwvZGl2Pjxk
aXY+wqDCoMKgwqDCoMKgwqAgIiIiPC9kaXY+PGRpdj7CoMKgwqDCoMKgwqDCoCB2YXIxID0gMzwv
ZGl2PjxkaXY+wqDCoMKgwqDCoMKgwqAgdmFyMiA9IGZ1bmMoMSwgdGVtcD17JzEnOjEsICcyJzoy
fSw8L2Rpdj48ZGl2PsKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIHRlbXAx
PVRlbXBDKFsxXSwgWzNdKSwgYWI9JzgzLCA4JywpPC9kaXY+PGRpdj7CoMKgwqDCoMKgwqDCoCB2
YXIzPSByJ1xuIHN0cic8L2Rpdj48ZGl2PsKgwqDCoMKgwqDCoMKgIHZhcjQgPSBmJ3RlbXAge1Rl
bXBDKCIxIisiMyIpfXx7diArICJtb24iICt2fWFuZCB7ZnVuYygpfSc8L2Rpdj48ZGl2PsKgPC9k
aXY+PGRpdj7CoMKgwqDCoMKgwqDCoCB8PC9kaXY+PGRpdj7CoDwvZGl2PjxkaXY+wqDCoMKgwqDC
oMKgwqAgdmFyYiA9ODMyPC9kaXY+PGRpdj7CoMKgwqDCoMKgwqDCoCBpZiB2YXJiOjwvZGl2Pjxk
aXY+wqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBwYXNzPC9kaXY+PGRpdj7CoMKgwqDCoMKgwqDCoCBl
bGlmIG5vdCB2YXJiIGlzIG5vdCBOb25lIGFuZCB2YXJiID09IDM6PC9kaXY+PGRpdj7CoMKgwqDC
oMKgwqDCoMKgwqDCoMKgIHZhcmIgPSAzODwvZGl2PjxkaXY+wqDCoMKgwqDCoMKgwqAgZWxzZTo8
L2Rpdj48ZGl2PsKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgcGFzczwvZGl2PjxkaXY+wqA8L2Rpdj48
ZGl2PsKgwqDCoMKgwqDCoMKgIGZvciBpIGluIHJhbmdlKCk6PC9kaXY+PGRpdj7CoMKgwqDCoMKg
wqDCoMKgwqDCoMKgIHByaW50KGkpPC9kaXY+PGRpdj7CoDwvZGl2PjxkaXY+wqDCoMKgwqDCoMKg
wqAgZGVmIG5lc3RlZCgpOjwvZGl2PjxkaXY+wqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBjbGFzcyBO
ZXN0ZWQoVGVtcGMpOjwvZGl2PjxkaXY+wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIGRl
ZiBfX2luaXRfXyhzZWxmKTo8L2Rpdj48ZGl2PsKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoMKgIHNlbGYuX2luaXQgPSBUcnVlPC9kaXY+PGRpdj7CoMKgwqDCoMKgwqDCoMKgwqDC
oMKgIHJldHVybiBOZXN0ZWQoKTwvZGl2PjxkaXY+wqDCoMKgwqDCoMKgwqAgcmV0dXJuIG5lc3Rl
ZDwvZGl2PjxkaXY+wqA8L2Rpdj48ZGl2PsKgPC9kaXY+PC9kaXY+PC9kaXY+PGRpdj7CoDwvZGl2
PjxkaXY+wqA8L2Rpdj48L2Rpdj48ZGl2PsKgPC9kaXY+PGRpdj7CoDwvZGl2PjwvZGl2PjxkaXY+
wqA8L2Rpdj48ZGl2PsKgPC9kaXY+PGRpdj4zMC4xMi4yMDIzLCAyMzoyMywgIll1YW4gRnUiICZs
dDs8YSBocmVmPSJtYWlsdG86Y2Fzb3VyaUBnbWFpbC5jb20iIHJlbD0ibm9vcGVuZXIgbm9yZWZl
cnJlciI+Y2Fzb3VyaUBnbWFpbC5jb208L2E+Jmd0Ozo8L2Rpdj48YmxvY2txdW90ZT48cD48YnIg
Lz7CoDwvcD48YmxvY2txdW90ZT7CoE9uIERlYyAzMCwgMjAyMywgYXQgODoyMSBBTSwgRGVuaXMg
WnViYXJldiAmbHQ7PGEgaHJlZj0ibWFpbHRvOmR2enViYXJldkB5YW5kZXgucnUiIHJlbD0ibm9v
cGVuZXIgbm9yZWZlcnJlciI+ZHZ6dWJhcmV2QHlhbmRleC5ydTwvYT4mZ3Q7IHdyb3RlOjxiciAv
PsKgPGJyIC8+wqAmZ3Q7IEkgcHVzaGVkIGEgZml4IGFuZCBub3cgaXQgc2hvdWxkbuKAmXQgY3Jh
c2ggYW55bW9yZS4gSG93ZXZlciwgSeKAmW0geWV0IG5vdCBzdXJlIHdoeSBhdCBzb21lIHBvaW50
IHRoZSBidWZmZXIgd2FzIHdpZGVuZWQuIElzIHRoZXJlIGFueSB3YXkgdG8gdHJhY2sgd2hvIGNh
bGxlZCB3aWRlbj88YnIgLz7CoMKgVGhhbmsgeW91LCBJdCBkb2Vzbid0IGNyYXNoIGFueW1vcmUu
PGJyIC8+wqDCoCZndDsgU28gaXQgc2VlbXMgd29ya2luZyBpbiBhIG5hcnJvd2VkIGJ1ZmZlciB3
b3VsZCB0cmlnZ2VyIGEgbG90IG9mIGJhY2stYW5kLWZvcnRjaCByZXBhcnNlLiBJIHdvbmRlciBp
ZiBpdOKAmXMgd29ydGggb3B0aW1pemluZyBmb3IgKGVnLCB1c2UgdHdvIHBhcnNlcnMgYmVoaW5k
IHRoZSBzY2VuZXMsIG9uZSBmb3Igd2lkZW5lZCBidWZmZXIgYW5kIG9uZSBmb3IgbmFycm93ZWQg
YnVmZmVyKS48YnIgLz7CoMKgSSBoYXZlIHBlcmZvcm1lZCBhIHF1aXRlIG5haXZlIGJlbmNobWFy
ayBhbmQgaGF2ZW4ndCBzZWVuIGFueSBzaWduaWZpY2FudCBzbG93IGRvd24gd2hlbiBpbnNlcnRp
bmcgdGV4dCBpbiBhIG5hcnJvd2VkIGJ1ZmZlci48L2Jsb2NrcXVvdGU+PHA+PGJyIC8+UmlnaHQs
IHdoZW4geW91IHR5cGUsIHNpbmNlIHRoZSBvbmx5IHRoaW5nIHRoYXQgYWNjZXNzIHRoZSBwYXJz
ZXIgaXMgZm9udC1sb2NrLCB3aGljaCBhbHdheXMgd2lkZW5zIHRoZSBidWZmZXIsIHRoZXJl4oCZ
cyBubyB1bm5lY2Vzc2FyeSByZXBhcnNlLiBJZiB5b3UgaW52b2tlIHNvbWUgZnVuY3Rpb24gdGhh
dCBhY2Nlc3MgdGhlIHBhcnNlciB3aGlsZSB0aGUgYnVmZmVyIGlzIG5hcnJvd2VkLCB0aGF04oCZ
bGwgdHJpZ2dlciBhIHJlcGFyc2UsIGFuZCB0aGUgbmV4dCB0aW1lIGZvbnQtbG9jayBydW5zLCBp
dOKAmWxsIHdpZGVuIGFuZCBtYWtlIHRoZSBwYXJzZXIgcmVwYXJzZSB0aGUgZnVsbCBidWZmZXIg
YWdhaW4uPGJyIC8+PGJyIC8+WXVhbjwvcD48L2Jsb2NrcXVvdGU+




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 31 Dec 2023 00:08:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 30 19:08:55 2023
Received: from localhost ([127.0.0.1]:45315 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rJjNu-0008Cf-Lr
	for submit <at> debbugs.gnu.org; Sat, 30 Dec 2023 19:08:55 -0500
Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:39535)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1rJjNp-0008CQ-9j
 for 67977 <at> debbugs.gnu.org; Sat, 30 Dec 2023 19:08:52 -0500
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailout.west.internal (Postfix) with ESMTP id 39D793200A01;
 Sat, 30 Dec 2023 19:08:42 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute6.internal (MEProxy); Sat, 30 Dec 2023 19:08:42 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm1; t=1703981321;
 x=1704067721; bh=CiRcDWZWjuuRoUil939HCGSzSjBItEOaZDjhv5FoW1I=; b=
 cS4g4RYtzMZN/pseD+JUH1laosOS971/SaF1wKOC0y3CiHxCSHlhYsYpTg/V3s6F
 z0yCKqR3U9ildn21/cVQr7Br9DAxU2E6YJuXvNoWE9KK+LdIyEEtYtJ1A43LIm52
 UXk3MCPVVhzlIKa3kaiL4HN70eXP6STjCM0KGhOlDjpnXUEDiVN4GSCdKd8FP/P9
 BRGe5V/OF0Or1Mb8MWuzDlETCtLjqDhqiqARmsVXDwKe7f0BvS2slXg7piqRMjyP
 7fwAMZb8dVR6lBBEhTHj0YOVHA6WBnTG16INudbope/CK79wwkWE4QuWTEmqi9tN
 mrIgpITrm4qhwYmDWsZikA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1703981321; x=
 1704067721; bh=CiRcDWZWjuuRoUil939HCGSzSjBItEOaZDjhv5FoW1I=; b=J
 eu1lZapQSUYW5gZuXJSpm2HN/Df4UFyiII1gN932t+2cLTX3MneotvWNBSPcpAJD
 hIP1VjiBDwoZxXV7CxbRvu5ZOUzdso8p5PCX0hNa6RXDf9vNa+PmN0BuBUeANAxR
 Rqtnt5nvv1Sp9bwLjgQ0tDltkDy2SscCD4eapt0Fp05rihOEIe07nsS/G0kepvrE
 UnPeCwToDgml8m31JTzqM3aZy5SVUIwbcKxBraZxpwsUP+NrntDALtoPR2KjtbZk
 oCJ6vyYlw6YCRrs6hMqYsIhYN9MY+jA7a9ldB1sqmB1RZbKhbVEdhZ3l9Z/WZ5nB
 yPDmTqHwNSx9pb5BwapXg==
X-ME-Sender: <xms:CbGQZTfO992sFWGlpSRSiTG_Hnn15WnztJLVLqW2ulre3C7I_6yDPw>
 <xme:CbGQZZNTcjobVJobT4-zqkDd1tfzkG5Hw3pfpN6OI3u1OOak2qaNlCaLSE8Ky4pwT
 _KaMNk6w-9UDN4JkdU>
X-ME-Received: <xmr:CbGQZcj_pxagHh2YjHLdRudJa9rkKRvzH5MwkUXbQWSwtWapEV1KQTCX6VITE69iSZfmfQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdefiedgvddtucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeetveegtedthefhudekteehffeu
 keeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:CbGQZU8EmRYUTWEdsxfKUDB-82A4bbgeERFlpIE657kt7LME3TI4KQ>
 <xmx:CbGQZfuTHdAuYEA6vPU7EEcEX1x6bpDgNF02Gjx8sNJ6H475TZ5Ckw>
 <xmx:CbGQZTEg1sXUWrg6Rti2SSf2vazZb7IxKis7ulLQtBs10Z-qT-bAUA>
 <xmx:CbGQZY4FyzchG8q3t3WnxsVkLjnKQuC6Z0XfOctKy6LRlnRExS-9yg>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
 30 Dec 2023 19:08:40 -0500 (EST)
Message-ID: <73eb1aed-9d8a-49a8-b50c-19739fb74197@HIDDEN>
Date: Sun, 31 Dec 2023 02:08:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
Content-Language: en-US
To: Yuan Fu <casouri@HIDDEN>, Denis Zubarev <dvzubarev@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN>
 <2141703952885@HIDDEN>
 <B100D4A5-F0ED-429F-B62C-9B052B5505E5@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <B100D4A5-F0ED-429F-B62C-9B052B5505E5@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 67977
Cc: Eli Zaretskii <eliz@HIDDEN>,
 "67977 <at> debbugs.gnu.org" <67977 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 30/12/2023 22:23, Yuan Fu wrote:
> 
>> On Dec 30, 2023, at 8:21 AM, Denis Zubarev<dvzubarev@HIDDEN>  wrote:
>>
>>> I pushed a fix and now it shouldn’t crash anymore. However, I’m yet not sure why at some point the buffer was widened. Is there any way to track who called widen?
>>   Thank you, It doesn't crash anymore.
>>   > So it seems working in a narrowed buffer would trigger a lot of back-and-fortch reparse. I wonder if it’s worth optimizing for (eg, use two parsers behind the scenes, one for widened buffer and one for narrowed buffer).
>>   I have performed a quite naive benchmark and haven't seen any significant slow down when inserting text in a narrowed buffer.
> Right, when you type, since the only thing that access the parser is font-lock, which always widens the buffer, there’s no unnecessary reparse. If you invoke some function that access the parser while the buffer is narrowed, that’ll trigger a reparse, and the next time font-lock runs, it’ll widen and make the parser reparse the full buffer again.

The difference might also only be noticeable with larger files: 
tree-sitter is pretty fast by itself, so an extra reparse might not make 
a difference unless it triggers a full re-fontification or application 
of text properties over a large span.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 30 Dec 2023 20:23:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 30 15:23:41 2023
Received: from localhost ([127.0.0.1]:45117 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rJfrw-0005Lr-M7
	for submit <at> debbugs.gnu.org; Sat, 30 Dec 2023 15:23:40 -0500
Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:42451)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1rJfrt-0005Lc-67
 for 67977 <at> debbugs.gnu.org; Sat, 30 Dec 2023 15:23:40 -0500
Received: by mail-pl1-x630.google.com with SMTP id
 d9443c01a7336-1d3ef33e68dso51155465ad.1
 for <67977 <at> debbugs.gnu.org>; Sat, 30 Dec 2023 12:23:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1703967810; x=1704572610; darn=debbugs.gnu.org;
 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=4n98kGptyybYjpEnjHGRJKbZfTLyJQdKyb09MwxLFUM=;
 b=dhDJMnqLaQPBRJuaF8VMdHaQkbJE+yva8EgVTSpeELHgtT9JqfMswa5AV7fuHOcClW
 lANd2WJizHJ4bEJUcr5Z3u6LFx4270iB+tpdoVVQUC535W85EpnlNbFrZdNcLJ3riSR4
 r50D8x+Rwb9cGHLbEQjGA8m+WPbU41HfyWPiVbcSx62EUpvOjYM26+oRZjlFkFRIYaxp
 pmwqosvDOitR9s/dK/9Up3Rmk/S/IGorx4BnLyhUrj/zrhFEkwemo3298hAwokUDKl7Q
 WV3dmMRBJlOUblSNWEbzqRyjfTP3KF7pHmf45ZJSH1qcS8aYyG4+/6eGvsHa/Eag0QO2
 GTZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1703967810; x=1704572610;
 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=4n98kGptyybYjpEnjHGRJKbZfTLyJQdKyb09MwxLFUM=;
 b=qNQq5d15UOUEsr8LWQA/bDURUCISazVDNrXxQ021Ta6osj+fMXubTKvAF3eHAc/S9p
 aD0/Ay2cfWhHVfJRBL1VaozhxZTVVQzqeyW5d9133h3bhh5fPQpp7P77mE8WxKbxwd3V
 Mi1kwH6mGDwJKP2mzSOCrTnzxt4nQHctOgKZi9B5zTW6NMzHulDekU6MsaOnOT9GcqGQ
 QAVAnFe8iN+TCm/nI7V6g34APaQe5popixSfxjELeRANFdkgxGZ3fvXbYO10KDaSZa36
 Ts3yX+kWe+KunxJVDF40bVSgZMf0GVLzdMWuloXBTdJsjmFttRMgLpuIGvsfDmNVwgT6
 2Rcw==
X-Gm-Message-State: AOJu0YwU1NbM7gHyqDjYRyppbQpNu74YWqYJM3MRVU0CZOZDERGktU7q
 vg+71Nz60ONxP/kZ2kYYyZU=
X-Google-Smtp-Source: AGHT+IHg8UYOiGPFZjQ0VvpttEqrOEqkPbyo5PfVSmei8Yx3w/DKUCeIEmhB6vh0FOSvAYJJ7jsNlw==
X-Received: by 2002:a17:902:d352:b0:1d0:6ffd:610d with SMTP id
 l18-20020a170902d35200b001d06ffd610dmr12898102plk.47.1703967810327; 
 Sat, 30 Dec 2023 12:23:30 -0800 (PST)
Received: from smtpclient.apple (172-117-161-177.res.spectrum.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 v1-20020a170902b7c100b001d40cc2c9c3sm16952554plz.35.2023.12.30.12.23.29
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 30 Dec 2023 12:23:30 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\))
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <2141703952885@HIDDEN>
Date: Sat, 30 Dec 2023 12:23:18 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <B100D4A5-F0ED-429F-B62C-9B052B5505E5@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN>
 <2141703952885@HIDDEN>
To: Denis Zubarev <dvzubarev@HIDDEN>
X-Mailer: Apple Mail (2.3731.700.6)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67977
Cc: Eli Zaretskii <eliz@HIDDEN>,
 "67977 <at> debbugs.gnu.org" <67977 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Dec 30, 2023, at 8:21 AM, Denis Zubarev <dvzubarev@HIDDEN> =
wrote:
>=20
> > I pushed a fix and now it shouldn=E2=80=99t crash anymore. However, =
I=E2=80=99m yet not sure why at some point the buffer was widened. Is =
there any way to track who called widen?
>  Thank you, It doesn't crash anymore.
>  > So it seems working in a narrowed buffer would trigger a lot of =
back-and-fortch reparse. I wonder if it=E2=80=99s worth optimizing for =
(eg, use two parsers behind the scenes, one for widened buffer and one =
for narrowed buffer).
>  I have performed a quite naive benchmark and haven't seen any =
significant slow down when inserting text in a narrowed buffer.

Right, when you type, since the only thing that access the parser is =
font-lock, which always widens the buffer, there=E2=80=99s no =
unnecessary reparse. If you invoke some function that access the parser =
while the buffer is narrowed, that=E2=80=99ll trigger a reparse, and the =
next time font-lock runs, it=E2=80=99ll widen and make the parser =
reparse the full buffer again.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 30 Dec 2023 16:21:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 30 11:21:43 2023
Received: from localhost ([127.0.0.1]:44912 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rJc5n-0007cg-7u
	for submit <at> debbugs.gnu.org; Sat, 30 Dec 2023 11:21:43 -0500
Received: from forward501a.mail.yandex.net ([178.154.239.81]:59932)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dvzubarev@HIDDEN>) id 1rJc5i-0007cT-PD
 for 67977 <at> debbugs.gnu.org; Sat, 30 Dec 2023 11:21:41 -0500
Received: from mail-nwsmtp-mxback-production-main-37.vla.yp-c.yandex.net
 (mail-nwsmtp-mxback-production-main-37.vla.yp-c.yandex.net
 [IPv6:2a02:6b8:c15:2e88:0:640:96dd:0])
 by forward501a.mail.yandex.net (Yandex) with ESMTP id CCE1061497;
 Sat, 30 Dec 2023 19:21:35 +0300 (MSK)
Received: from mail.yandex.ru (2a02:6b8:c18:4601:0:640:4d35:0
 [2a02:6b8:c18:4601:0:640:4d35:0])
 by mail-nwsmtp-mxback-production-main-37.vla.yp-c.yandex.net (mxback/Yandex)
 with HTTP id iKarls0tW0U0-dA1BeLdK; Sat, 30 Dec 2023 19:21:35 +0300
X-Yandex-Fwd: 1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
 t=1703953295; bh=5KSCvmoBMI0LrSt+WLy2zCPzkj16fR/u6NZWxlsQwJM=;
 h=Message-Id:References:Date:Cc:Subject:In-Reply-To:To:From;
 b=qKt9UuRk4D+SFKqrRPysWRpKo8Vp15n3xiGrSCCK/e/GBRMO6uqKrOkb79SyL4AhR
 YMoEW+Jv7VL3kVZPeR9I3AH7jNEcaqdz1KiW9dobU5pBna48XL6Npg5XK5lAcNsA3r
 GnTU4s4q/Cz13QB68FSPKI8NsCChL3+I1X4ZTkDc=
Authentication-Results: mail-nwsmtp-mxback-production-main-37.vla.yp-c.yandex.net;
 dkim=pass header.i=@yandex.ru
Received: by fttg4r4wmjvthz4h.vla.yp-c.yandex.net with HTTP;
 Sat, 30 Dec 2023 19:21:35 +0300
From: Denis Zubarev <dvzubarev@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>,
	Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN>
Subject: Re: bug#67977: 30.0.50;
 tree-sitter: Emacs crashes when accessing treesit-nodes in a narrowed
 buffer
MIME-Version: 1.0
X-Mailer: Yamail [ http://yandex.ru ] 5.0
Date: Sat, 30 Dec 2023 19:21:35 +0300
Message-Id: <2141703952885@HIDDEN>
Content-Transfer-Encoding: base64
Content-Type: text/html; charset=utf-8
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 67977
Cc: "67977 <at> debbugs.gnu.org" <67977 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

PGRpdj4mZ3Q7IEkgcHVzaGVkIGEgZml4IGFuZCBub3cgaXQgc2hvdWxkbuKAmXQgY3Jhc2ggYW55
bW9yZS4gSG93ZXZlciwgSeKAmW0geWV0IG5vdCBzdXJlIHdoeSBhdCBzb21lIHBvaW50IHRoZSBi
dWZmZXIgd2FzIHdpZGVuZWQuIElzIHRoZXJlIGFueSB3YXkgdG8gdHJhY2sgd2hvIGNhbGxlZCB3
aWRlbj88L2Rpdj48ZGl2PsKgPC9kaXY+PGRpdj5UaGFuayB5b3UsIEl0IGRvZXNuJ3QgY3Jhc2gg
YW55bW9yZS48L2Rpdj48ZGl2PsKgPC9kaXY+PGRpdj4mZ3Q7IFNvIGl0IHNlZW1zIHdvcmtpbmcg
aW4gYSBuYXJyb3dlZCBidWZmZXIgd291bGQgdHJpZ2dlciBhIGxvdCBvZiBiYWNrLWFuZC1mb3J0
Y2ggcmVwYXJzZS4gSSB3b25kZXIgaWYgaXTigJlzIHdvcnRoIG9wdGltaXppbmcgZm9yIChlZywg
dXNlIHR3byBwYXJzZXJzIGJlaGluZCB0aGUgc2NlbmVzLCBvbmUgZm9yIHdpZGVuZWQgYnVmZmVy
IGFuZCBvbmUgZm9yIG5hcnJvd2VkIGJ1ZmZlcikuPC9kaXY+PGRpdj7CoDwvZGl2PjxkaXY+SSBo
YXZlIHBlcmZvcm1lZCBhIHF1aXRlIG5haXZlIGJlbmNobWFyayBhbmQgaGF2ZW4ndCBzZWVuIGFu
eSBzaWduaWZpY2FudCBzbG93IGRvd24gd2hlbiBpbnNlcnRpbmcgdGV4dCBpbiBhIG5hcnJvd2Vk
IGJ1ZmZlci48L2Rpdj48ZGl2PsKgPC9kaXY+PGRpdj4yNC4xMi4yMDIzLCAwNjowMSwgIll1YW4g
RnUiICZsdDtjYXNvdXJpQGdtYWlsLmNvbSZndDs6PC9kaXY+PGJsb2NrcXVvdGU+PHA+PGJyIC8+
wqA8L3A+PGJsb2NrcXVvdGU+wqBPbiBEZWMgMjMsIDIwMjMsIGF0IDEyOjA4IEFNLCBZdWFuIEZ1
ICZsdDs8YSBocmVmPSJtYWlsdG86Y2Fzb3VyaUBnbWFpbC5jb20iIHJlbD0ibm9vcGVuZXIgbm9y
ZWZlcnJlciI+Y2Fzb3VyaUBnbWFpbC5jb208L2E+Jmd0OyB3cm90ZTo8YnIgLz7CoDxiciAvPsKg
PGJyIC8+wqA8YmxvY2txdW90ZT7CoE9uIERlYyAyMiwgMjAyMywgYXQgMTE6MjYgUE0sIEVsaSBa
YXJldHNraWkgJmx0OzxhIGhyZWY9Im1haWx0bzplbGl6QGdudS5vcmciIHJlbD0ibm9vcGVuZXIg
bm9yZWZlcnJlciI+ZWxpekBnbnUub3JnPC9hPiZndDsgd3JvdGU6PGJyIC8+wqA8YmxvY2txdW90
ZT7CoEZyb206IERlbmlzIFp1YmFyZXYgJmx0OzxhIGhyZWY9Im1haWx0bzpkdnp1YmFyZXZAeWFu
ZGV4LnJ1IiByZWw9Im5vb3BlbmVyIG5vcmVmZXJyZXIiPmR2enViYXJldkB5YW5kZXgucnU8L2E+
Jmd0OzxiciAvPsKgRGF0ZTogU2F0LCAyMyBEZWMgMjAyMyAwMjoxODoyMCArMDMwMDxiciAvPsKg
PGJyIC8+wqAxLiBlbWFjcyAtUTxiciAvPsKgMi4gTS14IGZpbmQtZmlsZSAvdG1wL3QucHk8YnIg
Lz7CoDMuIHBhc3RlIHRoZXJlPGJyIC8+wqBzdGFydD0xPGJyIC8+wqBkZWYgX2luaXQoc2VsZiwg
cGFyYW0xLCBwYXJhbTIsIHBhcmFtMz1GYWxzZSk6PGJyIC8+wqDCoMKgc2VsZi5fcGFyYW0xID0g
cGFyYW0yPGJyIC8+wqDCoMKgc2VsZi5fcGFyYW0yID0gcGFyYW0yPGJyIC8+wqDCoMKgc2VsZi5f
cGFyYW0zID0gcGFyYW0zPGJyIC8+wqA0LiBweXRob24tdHMtbW9kZTxiciAvPsKgNS4gc2VsZWN0
IHR3byBsYXN0IGxpbmVzIGFuZCBNLXggbmFycm93LXRvLXJlZ2lvbjxiciAvPsKgNi4gYW5zd2Vy
IGFsbCBwcm9tcHRzPGJyIC8+wqA3LiBQdXQgY3Vyc29yIG9uIHRoZSBsYXN0IHNlbGY8YnIgLz7C
oDguIE0teCBldmFsLWV4cHJlc3Npb248YnIgLz7CoChwcm9nbjxiciAvPsKgKHNldHEgdGVtcC1u
b2RlICh0cmVlc2l0LW5vZGUtYXQgKHBvaW50KSkpPGJyIC8+wqAoc2l0LWZvciAyKTxiciAvPsKg
KGdhcmJhZ2UtY29sbGVjdCk8YnIgLz7CoChtZXNzYWdlICJub2RlICVzIiB0ZW1wLW5vZGUpKTxi
ciAvPsKgOS4gRW1hY3MgY3Jhc2hlcyBvciBwcmludHMgbm9kZSB0aGF0IGNvbnRhaW5zIGdhcmJh
Z2U8L2Jsb2NrcXVvdGU+wqA8YnIgLz7CoFRoYW5rcy48YnIgLz7CoDxiciAvPsKgWXVhbiwgdGhp
cyBhbHNvIGhhcHBlbnMgb24gdGhlIGVtYWNzLTI5IGJyYW5jaCwgc28gd2Ugc2hvdWxkIHRyeTxi
ciAvPsKgZml4aW5nIHRoaXMgY3Jhc2ggQVNBUC48L2Jsb2NrcXVvdGU+wqA8YnIgLz7CoFllYWgu
IFRoZSBub2RlIHdhbnRzIHRvIHByaW50IGl04oCZcyB0eXBlIG5hbWUgKHdpdGggdHNfbm9kZV90
eXBlKSwgd2hpY2ggYWNjZXNzIGl04oCZcyBwYXJzZSB0cmVlLCBidXQgdGhlIHRyZWUgaXMgYWxy
ZWFkeSBmcmVlZCwgdGhhdCBtZWFucyB0aGUgbm9kZSBpcyBvdXRkYXRlZCBhbmQgc2hvdWxkbuKA
mXQgdHJ5IHRvIHByaW50IGl04oCZcyB0eXBlIG5hbWUsIGJ1dCBzaG91bGQgcmF0aGVyIHByaW50
IOKAnG91dGRhdGVk4oCdLjxiciAvPsKgPGJyIC8+wqBCdXQgc2ltcGx5IG5hcnJvd2luZyB0aGUg
YnVmZmVyIHNob3VsZG7igJl0IHJlcGFyc2UgdGhlIGJ1ZmZlciBhbmQgY2F1c2UgdGhlIHBhcnNl
IHRyZWUgdG8gYmUgZnJlZWQuIEFueXdheSwgbGV0IG1lIHNlZSB3aGF04oCZcyBnb2luZyBvbi48
L2Jsb2NrcXVvdGU+PHA+PGJyIC8+PGJyIC8+SSBwdXNoZWQgYSBmaXggYW5kIG5vdyBpdCBzaG91
bGRu4oCZdCBjcmFzaCBhbnltb3JlLiBIb3dldmVyLCBJ4oCZbSB5ZXQgbm90IHN1cmUgd2h5IGF0
IHNvbWUgcG9pbnQgdGhlIGJ1ZmZlciB3YXMgd2lkZW5lZC4gSXMgdGhlcmUgYW55IHdheSB0byB0
cmFjayB3aG8gY2FsbGVkIHdpZGVuPzxiciAvPjxiciAvPll1YW48L3A+PC9ibG9ja3F1b3RlPg==




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 30 Dec 2023 04:36:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 29 23:36:06 2023
Received: from localhost ([127.0.0.1]:42798 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rJR4v-0000bC-Rf
	for submit <at> debbugs.gnu.org; Fri, 29 Dec 2023 23:36:06 -0500
Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]:51711)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1rJR4t-0000ag-15
 for 67977 <at> debbugs.gnu.org; Fri, 29 Dec 2023 23:36:04 -0500
Received: by mail-ot1-x32c.google.com with SMTP id
 46e09a7af769-6dc049c7b58so2044608a34.3
 for <67977 <at> debbugs.gnu.org>; Fri, 29 Dec 2023 20:36:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1703910957; x=1704515757; darn=debbugs.gnu.org;
 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=cKkB4376IDAPuFI1s8JDi40UOl+Gpzuc7pGngrVopVs=;
 b=JNgCN5fHYpPkLhXHZ0Gi/+U4GSCwH41bIA81oeR0FosGOtwaT+E//6S80glnmdwo0f
 Pnrx+NsofL9WeHsIVqozAjmwQhGv1kUBfjNZfpd3sCnAoIKnHrdVJ3VOzza2G782E0br
 uKE3n+ruNysWDQCznSwGTMxk9ou0uKZEVErNE5MgA0kirGCgwLvnXpOpXGE7g7t/r09o
 X7zAQP3ZLQa6sLEzBYTTkzjYyzAys+D+0AjCC8C8YxJqt2wlJ1WbNWfldOqVCouM4mT6
 Gy00YJIJkQcwGXQnjsFmDHU7HPZVZxEAmuYX8ZC2oA19+MJgxAn8YX+yD5XTcqJTUPQy
 YwbA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1703910957; x=1704515757;
 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=cKkB4376IDAPuFI1s8JDi40UOl+Gpzuc7pGngrVopVs=;
 b=K3LwLdOUhbjMKkY/neFiBk1llB0jIskH/vPqXzmd//mC+lrRR3jzuM+kiCdL7Od2tR
 Ob5p+IB7K/Yuu/ucEyBJJJnqiICPbK1wpo51mtnTnHJfDQ+dLbyh4xQmcKycBVh6/5py
 VYbi+E4NYYJI0yHhjfBTTiiFBblDq0hKn0+q8Gr6Ir7pMbI8dwbALMoevSeoilfQTlc2
 7BAYJWQVbol2UlZaoi+gw+s+V6NgWGvHmxZ9hYcNCWlkI304+L7ffpIDh0TQm8Q3AhIj
 tUDjwKAAA9zKU1/epMpyEGWGmMAqUpQ8TlryqU+I4mbuf8FI9wRAJ1XGAO86GzUbfIc9
 eqcA==
X-Gm-Message-State: AOJu0Yx+qYob1ZvciUhLv2U//5n5BEoj0qUBseiy6GXrVlbHlaqVr/B1
 whTQ2xP/+VF0D6DP0vaTctQ=
X-Google-Smtp-Source: AGHT+IElVlaS+khdSpsebiU6ZeTnvwnSFDanuDKec3qyXmJMBPaXeslL5NAuI/5owhEscr5ri1S4fA==
X-Received: by 2002:a05:6808:1203:b0:3bb:dc36:962d with SMTP id
 a3-20020a056808120300b003bbdc36962dmr3201702oil.77.1703910956997; 
 Fri, 29 Dec 2023 20:35:56 -0800 (PST)
Received: from smtpclient.apple (172-117-161-177.res.spectrum.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 x11-20020a056a00188b00b006d9fa8a8c27sm5983712pfh.168.2023.12.29.20.35.56
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 29 Dec 2023 20:35:56 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\))
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <52f3f5c0-fc5a-46fa-949f-33437fd8878a@HIDDEN>
Date: Fri, 29 Dec 2023 20:35:45 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <C0B7B2EF-E5EB-445D-BBF5-6B5CB9274ED6@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN> <83edfccbwi.fsf@HIDDEN>
 <262157E9-A92C-4063-ADA4-725C156FB227@HIDDEN> <83r0j79522.fsf@HIDDEN>
 <FFBB4602-AEE6-49BB-979E-9205B86F0C45@HIDDEN>
 <b11799ff-11a6-48bb-b9e4-ec5d69fa23c2@HIDDEN> <83tto277s1.fsf@HIDDEN>
 <c7da3cfd-3ea3-4775-8470-ad35d2062470@HIDDEN>
 <E0DA9858-2C41-436D-9FFE-37B5FF10CA1A@HIDDEN>
 <52f3f5c0-fc5a-46fa-949f-33437fd8878a@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
X-Mailer: Apple Mail (2.3731.700.6)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67977
Cc: Eli Zaretskii <eliz@HIDDEN>, Denis Zubarev <dvzubarev@HIDDEN>,
 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Dec 29, 2023, at 4:48 AM, Dmitry Gutov <dmitry@HIDDEN> wrote:
>=20
> On 29/12/2023 09:00, Yuan Fu wrote:
>>> On Dec 28, 2023, at 8:16 AM, Dmitry Gutov <dmitry@HIDDEN> wrote:
>>>=20
>>> On 28/12/2023 15:53, Eli Zaretskii wrote:
>>>>> Date: Thu, 28 Dec 2023 13:44:43 +0200
>>>>> Cc: Denis Zubarev<dvzubarev@HIDDEN>,67977 <at> debbugs.gnu.org
>>>>> From: Dmitry Gutov<dmitry@HIDDEN>
>>>>>=20
>>>>>>> Could font-lock-dont-widen help, perhaps?
>>>>>> Yes. If font-lock doesn=E2=80=99t widen, then there wouldn=E2=80=99=
t be back-and-forth reparses.
>>>>> But then treesit major modes will be affected by user narrowing =
(e.g. if
>>>>> the user narrowed to inside the string, the buffer won't be =
highlighted
>>>>> as a string).
>>>> Why is that a problem?  When the user narrows the buffer, the part
>>>> outside the narrowing doesn't exist as far as Emacs is concerned.
>>>=20
>>> That's not how it works in most major modes, at least since the =
introduction of font-lock-dont-widen 20 years ago.
>>>=20
>>> Like its docstring says, the exceptions were supposed to be weird =
modes like RMAIL and Info which use narrowing for their own purposes =
(that seems buggy in Info's case, when 'C-x n w' breaks the intended =
display right away). But even Info-mode doesn't actually change =
font-lock-dont-widen, actually, because the apparent behavior would be =
the same. But it could.
>>>=20
>>> I don't have a personal stake in this (I never use narrowing =
interactively). But maybe you'll want to make a poll, to ask the users =
that do.
>> I guess that depends on how you view narrowing, I assume most of the =
time the user considers narrowing to be something that narrows the view =
to a region, rather than effectively removing the rest of the buffer. =
IIRC We=E2=80=99ve had discussions on adding =E2=80=9Ctypes=E2=80=9D to =
narrows but to no conclusion.
>=20
> Indeed.
>=20
>> Anyway, if the reparse caused by narrowing prove to be problematic, I =
can implement the optimization I mentioned earlier, where we use two =
parsers, one for when buffer is widened and one for when buffer is =
narrowed. This will be in C and is transparent to lisp.
>=20
> This definitely can work, but perhaps we should examine concrete use =
cases first. It could be that the caller would want the full parse tree =
available anyway, when the view was narrowed interactively by the user.
>=20
> Then the actual advice from us would be to (save-restriction (widen =
...)) anyway, and the second parse tree would stay mostly unused.

I=E2=80=99m sure both strict and non-strict narrowing has their =
use-cases. For movement functions, we probably don=E2=80=99t want to =
widen; for indentation, I think both could be useful depending on, =
again, specific use-cases.

I don=E2=80=99t think any of use are motivated enough :-) We can wait =
until someone with a specific problem/requirement comes up.

>=20
> It's a good thing to have fixed the crash, though, so the developers =
can try it both ways and decide what's best for them.

Right, Lisp programmers can decide whether they want to widen. And if =
there are enough important use-cases for widening, we can starting =
thinking about optimizing switching back-and-forth between narrowed and =
widened buffer.

Yuan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 29 Dec 2023 12:48:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 29 07:48:45 2023
Received: from localhost ([127.0.0.1]:40972 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rJCI9-00058h-Ab
	for submit <at> debbugs.gnu.org; Fri, 29 Dec 2023 07:48:45 -0500
Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:46815)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1rJCI7-00057x-57
 for 67977 <at> debbugs.gnu.org; Fri, 29 Dec 2023 07:48:43 -0500
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
 by mailout.west.internal (Postfix) with ESMTP id 2352C3200A4B;
 Fri, 29 Dec 2023 07:48:37 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute3.internal (MEProxy); Fri, 29 Dec 2023 07:48:37 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm1; t=1703854116;
 x=1703940516; bh=nqOeTrCnetvndXApxl3hl0FVFuG7y3GXuZn1yiH+7mM=; b=
 cKPAHWj95KxhhdRU69tNJvLE/8goY3AuLHcdtvnp7/eKsAwZzXwg+ZnA6/gTsyru
 aVduxGqk93M9fejSquYPn41A2qAD2kC7cZ/whq+vFLO7MpvzGMSPgGBIqzqKJ/fc
 GTz24IXCqI/yOKsw3gs1Q5sk8x1NY99T3UZ1xvMdAeq4IuAFNjWcb3sTzEMR1OGl
 TGIgrYGFkt7QJI1H2kAV/JWvjy9DwpWXByP8WiiX2gAeqX5JhrfvcEonhYUAq+O6
 pA2CVSvQeKkPwZ/XkUrG6/GexXA+0FYXwskt4hrjzlSkJgeSgBzfMjJ36rpa0I34
 WEHd+msUsEEv0vbQ315ewg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1703854116; x=
 1703940516; bh=nqOeTrCnetvndXApxl3hl0FVFuG7y3GXuZn1yiH+7mM=; b=1
 4DJWJhomlA+2MTCsaufC6evOuaDdEc2hr0cHwguTxYzxzsPIBYHhaxYi0nuCDOoX
 +ctTIFtTs1w2PgfTauRzYBOqQ+eT1U5G6APiqN5Vf2IlSYsygMDijgZLslZXt7fx
 w959E09s5+PCPR6IPBMdkn1DqfBz2sQkB1O/GIeyJZ6/mlDWaXrDA/MJZSem1cxq
 l62PK2vV/GzvAUHHMXR1t8e2cUvQX1fZ2YYsEDcNcgERYA+vuBllMwKJmHR7nHF9
 pEXP05czRvY9U3j4PC70sry8Sa97CbfKWols63kaJKfrC5HfrLlTUjkq3+TcI23c
 eYg9X397tVbDGzvfV7m6A==
X-ME-Sender: <xms:JMCOZS2NgCfrnmIFZOqYyC2jS3lHv1VY7Y9rVVCiPm_TsqmCC-1bFA>
 <xme:JMCOZVGmBMSIO62eRTX7Q3tjYeAthz7UM-tklBgn9stfHwK7DPBg9S0kUaqAuYITt
 w9IKYfcUeQZIdTPHWE>
X-ME-Received: <xmr:JMCOZa7ucytN-m_iudVwMGJDx5LshjWbA1d8a4eeHwCyenQgRpgClOwWi5bfOsGQ5TcTxg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeffedggeehucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeetveegtedthefhudekteehffeu
 keeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:JMCOZT1gGNqf3uPRhmh2V9ozq4OBv-u47SiV9SQVc8ZHlg2axX6moA>
 <xmx:JMCOZVGMV51cAn9Vtli8OApPLTpxn86N89KtDTdmndAMXE6pY75a8A>
 <xmx:JMCOZc8g6r9BNv8NsmcGWGU-J8NupvF8UQzVVFPpC71emNTB9X4wTg>
 <xmx:JMCOZaRy7_t46uiDwDJvtCALRqH9RSB2j78laLWCSAD-FcN9QiA7sQ>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 29 Dec 2023 07:48:34 -0500 (EST)
Message-ID: <52f3f5c0-fc5a-46fa-949f-33437fd8878a@HIDDEN>
Date: Fri, 29 Dec 2023 14:48:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
Content-Language: en-US
To: Yuan Fu <casouri@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN> <83edfccbwi.fsf@HIDDEN>
 <262157E9-A92C-4063-ADA4-725C156FB227@HIDDEN> <83r0j79522.fsf@HIDDEN>
 <FFBB4602-AEE6-49BB-979E-9205B86F0C45@HIDDEN>
 <b11799ff-11a6-48bb-b9e4-ec5d69fa23c2@HIDDEN> <83tto277s1.fsf@HIDDEN>
 <c7da3cfd-3ea3-4775-8470-ad35d2062470@HIDDEN>
 <E0DA9858-2C41-436D-9FFE-37B5FF10CA1A@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <E0DA9858-2C41-436D-9FFE-37B5FF10CA1A@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 67977
Cc: Eli Zaretskii <eliz@HIDDEN>, dvzubarev@HIDDEN, 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 29/12/2023 09:00, Yuan Fu wrote:
> 
> 
>> On Dec 28, 2023, at 8:16 AM, Dmitry Gutov <dmitry@HIDDEN> wrote:
>>
>> On 28/12/2023 15:53, Eli Zaretskii wrote:
>>>> Date: Thu, 28 Dec 2023 13:44:43 +0200
>>>> Cc: Denis Zubarev<dvzubarev@HIDDEN>,67977 <at> debbugs.gnu.org
>>>> From: Dmitry Gutov<dmitry@HIDDEN>
>>>>
>>>>>> Could font-lock-dont-widen help, perhaps?
>>>>> Yes. If font-lock doesn’t widen, then there wouldn’t be back-and-forth reparses.
>>>> But then treesit major modes will be affected by user narrowing (e.g. if
>>>> the user narrowed to inside the string, the buffer won't be highlighted
>>>> as a string).
>>> Why is that a problem?  When the user narrows the buffer, the part
>>> outside the narrowing doesn't exist as far as Emacs is concerned.
>>
>> That's not how it works in most major modes, at least since the introduction of font-lock-dont-widen 20 years ago.
>>
>> Like its docstring says, the exceptions were supposed to be weird modes like RMAIL and Info which use narrowing for their own purposes (that seems buggy in Info's case, when 'C-x n w' breaks the intended display right away). But even Info-mode doesn't actually change font-lock-dont-widen, actually, because the apparent behavior would be the same. But it could.
>>
>> I don't have a personal stake in this (I never use narrowing interactively). But maybe you'll want to make a poll, to ask the users that do.
> 
> I guess that depends on how you view narrowing, I assume most of the time the user considers narrowing to be something that narrows the view to a region, rather than effectively removing the rest of the buffer. IIRC We’ve had discussions on adding “types” to narrows but to no conclusion.

Indeed.

> Anyway, if the reparse caused by narrowing prove to be problematic, I can implement the optimization I mentioned earlier, where we use two parsers, one for when buffer is widened and one for when buffer is narrowed. This will be in C and is transparent to lisp.

This definitely can work, but perhaps we should examine concrete use 
cases first. It could be that the caller would want the full parse tree 
available anyway, when the view was narrowed interactively by the user.

Then the actual advice from us would be to (save-restriction (widen 
...)) anyway, and the second parse tree would stay mostly unused.

It's a good thing to have fixed the crash, though, so the developers can 
try it both ways and decide what's best for them.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 29 Dec 2023 07:00:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 29 02:00:39 2023
Received: from localhost ([127.0.0.1]:40673 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rJ6rG-0002CJ-Ik
	for submit <at> debbugs.gnu.org; Fri, 29 Dec 2023 02:00:39 -0500
Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:54492)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1rJ6rD-0001z8-Qm
 for 67977 <at> debbugs.gnu.org; Fri, 29 Dec 2023 02:00:37 -0500
Received: by mail-pf1-x429.google.com with SMTP id
 d2e1a72fcca58-6d9f94b9186so1787667b3a.0
 for <67977 <at> debbugs.gnu.org>; Thu, 28 Dec 2023 23:00:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1703833230; x=1704438030; darn=debbugs.gnu.org;
 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=D6Z6oStJYKVZMYHKvCDlWFnfVQVufw5NKO3Z9uammrA=;
 b=dAxdWUpLuEbwcQFfb/rUWDL3AGiQ/LB62rYQXQ8y8aEFq5J5qbYDsvtJPLMGIgvInl
 ulxO1DOdvhJbuQsQGnxmU0nL5bisAHKvNZC29egWOe1zBGZRaZasVALn0s9cQwG0t9LL
 qtWRe2NJTyQ47SNWeKkJiCyf/8gMMVpG+gKtF8VfUasvKHwzuSBagcyo+AucX+JjANOK
 7jndl3feI7vDRvDrhuErO+aSbUK8SjYDbwtdM5UfcCv5JIc+L6MEkQRRTpitXlRe3Chg
 9bZqx7rlWgFDbE90dpGlu3Y6IAYT6KMpjYChp7zxOgcWUGZasWgioSWBVZ1wLKkFAsfP
 FH2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1703833230; x=1704438030;
 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=D6Z6oStJYKVZMYHKvCDlWFnfVQVufw5NKO3Z9uammrA=;
 b=YLdrnXLFV0ndpfhdefftKy31Y9OwWV0s2TKJ4/X1SflHavDnYLJ9fEVppdtmA4q46m
 ayBm82kJLK58hn5pyb5rWCyTHeUrXh+VxhfT5ruw8aeI7BKbn16NbxMzXvehNbyv/MQR
 Osf+1FpL89DtYmp6f9l6zCdtVE73AGuHYYu/4/UysF6CvswnB7Gm0yn162vr3Av9QM9n
 J/eckgATSG3jHAnfa7ahd7/s1IyfjNnzWsP354DaexW3Kxsh3Fp0U8P2+U23p5w3waVh
 LQOgrlY8Nbz+vfZwEX+pOdrohfyvN6UGNLxb+Y9o6h5ikCYJlnvknaHJJQMYwcUvjyc6
 WrDQ==
X-Gm-Message-State: AOJu0YymlWWDcHlEy6Tm4ejfAsYTBYrdMwVnvNkeYPj3WQmyQDc8Ebvc
 lvu9EFpjQblDH8dn/CpziyI=
X-Google-Smtp-Source: AGHT+IGEwjiduQ/CsimI4ZLghXt3oJkrrC+eQ0wU4CJljfYg0ILdsEy3HOtWYZfk0Tb3aU3vk67HTQ==
X-Received: by 2002:a05:6a20:8e03:b0:196:70ec:b9bd with SMTP id
 y3-20020a056a208e0300b0019670ecb9bdmr1339836pzj.84.1703833230099; 
 Thu, 28 Dec 2023 23:00:30 -0800 (PST)
Received: from smtpclient.apple (172-117-161-177.res.spectrum.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 ft5-20020a17090b0f8500b0028c89122f8asm5096845pjb.6.2023.12.28.23.00.29
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 28 Dec 2023 23:00:29 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\))
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <c7da3cfd-3ea3-4775-8470-ad35d2062470@HIDDEN>
Date: Thu, 28 Dec 2023 23:00:18 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <E0DA9858-2C41-436D-9FFE-37B5FF10CA1A@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN> <83edfccbwi.fsf@HIDDEN>
 <262157E9-A92C-4063-ADA4-725C156FB227@HIDDEN> <83r0j79522.fsf@HIDDEN>
 <FFBB4602-AEE6-49BB-979E-9205B86F0C45@HIDDEN>
 <b11799ff-11a6-48bb-b9e4-ec5d69fa23c2@HIDDEN> <83tto277s1.fsf@HIDDEN>
 <c7da3cfd-3ea3-4775-8470-ad35d2062470@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
X-Mailer: Apple Mail (2.3731.700.6)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67977
Cc: Eli Zaretskii <eliz@HIDDEN>, dvzubarev@HIDDEN, 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Dec 28, 2023, at 8:16 AM, Dmitry Gutov <dmitry@HIDDEN> wrote:
>=20
> On 28/12/2023 15:53, Eli Zaretskii wrote:
>>> Date: Thu, 28 Dec 2023 13:44:43 +0200
>>> Cc: Denis Zubarev<dvzubarev@HIDDEN>,67977 <at> debbugs.gnu.org
>>> From: Dmitry Gutov<dmitry@HIDDEN>
>>>=20
>>>>> Could font-lock-dont-widen help, perhaps?
>>>> Yes. If font-lock doesn=E2=80=99t widen, then there wouldn=E2=80=99t =
be back-and-forth reparses.
>>> But then treesit major modes will be affected by user narrowing =
(e.g. if
>>> the user narrowed to inside the string, the buffer won't be =
highlighted
>>> as a string).
>> Why is that a problem?  When the user narrows the buffer, the part
>> outside the narrowing doesn't exist as far as Emacs is concerned.
>=20
> That's not how it works in most major modes, at least since the =
introduction of font-lock-dont-widen 20 years ago.
>=20
> Like its docstring says, the exceptions were supposed to be weird =
modes like RMAIL and Info which use narrowing for their own purposes =
(that seems buggy in Info's case, when 'C-x n w' breaks the intended =
display right away). But even Info-mode doesn't actually change =
font-lock-dont-widen, actually, because the apparent behavior would be =
the same. But it could.
>=20
> I don't have a personal stake in this (I never use narrowing =
interactively). But maybe you'll want to make a poll, to ask the users =
that do.

I guess that depends on how you view narrowing, I assume most of the =
time the user considers narrowing to be something that narrows the view =
to a region, rather than effectively removing the rest of the buffer. =
IIRC We=E2=80=99ve had discussions on adding =E2=80=9Ctypes=E2=80=9D to =
narrows but to no conclusion.

Anyway, if the reparse caused by narrowing prove to be problematic, I =
can implement the optimization I mentioned earlier, where we use two =
parsers, one for when buffer is widened and one for when buffer is =
narrowed. This will be in C and is transparent to lisp.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 28 Dec 2023 16:16:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 28 11:16:41 2023
Received: from localhost ([127.0.0.1]:40215 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rIt3p-00032d-GX
	for submit <at> debbugs.gnu.org; Thu, 28 Dec 2023 11:16:41 -0500
Received: from out2-smtp.messagingengine.com ([66.111.4.26]:59339)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1rIt3n-00032O-9k
 for 67977 <at> debbugs.gnu.org; Thu, 28 Dec 2023 11:16:40 -0500
Received: from compute2.internal (compute2.nyi.internal [10.202.2.46])
 by mailout.nyi.internal (Postfix) with ESMTP id 2FFF85C00F5;
 Thu, 28 Dec 2023 11:16:34 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute2.internal (MEProxy); Thu, 28 Dec 2023 11:16:34 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm1; t=1703780194;
 x=1703866594; bh=m0kRIDhIQdgubAZs0/6l02YzhGxm4Ft4WGJ7rjzdE0s=; b=
 SafxavqojoRTwJvT6GODw5wyNsi2GDYAn/kCayqMiIPZILcVLw6STWHYcwUEhiMi
 kkAlOyyXjhTC6oD9QjI0/wXeUur9HESQ5R4VN1gFILA4D2vMEfsYNm0VZvNBndid
 g+f/5fkml1O4Ai4+EitXMJzJ85TClze0ZcqLyQGS/xU2ne89nKOuEf1jo2Y5FPN8
 N6CU+HVh0AQJGuLJjcKr7YLcPJZfKsX+X6DFPGoWoe9XVyBKPipzB6qZVF0DAfHW
 3ucyNdYAbet8IBAKZ+MGj35PTP6fl+6EEi5OumRrAz+nB1RkGvz2N0iAW1CoojWc
 ajGQd9g9Ir3rWk+HlBgizw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1703780194; x=
 1703866594; bh=m0kRIDhIQdgubAZs0/6l02YzhGxm4Ft4WGJ7rjzdE0s=; b=7
 aeq2oizJ2ONg1+oxJ3c4pvMqp2ytREJwBo7KsACkvuoCcMbTOv7ERCxSba4d9kHW
 ZM6z9AN4OtT5M2w4oK770fGBS5nMBzAEZ3/P2lCTkHZWJPuEQXvjXMNP0Pm1118H
 e/sRwFQb+BDjixbsdhcICarwQZDYdFG3PQRsmEYMaGMHqHF6JesAJIaN5Is7E2gW
 Teq5BnI8ovWpqT1GmgrE1/J7uBjappmRb5svzthqJXPlAUR0kSfCBqhsH1LpahkL
 swL2mHZ3WN6tr8d3smLc4rQBJ4EUlQ9MoeJrC9ljUYlgjSFOs6WqhtAjutjlv/eD
 VmWXwTj1uF1NmMeiuXfmA==
X-ME-Sender: <xms:YZ-NZUTp0-wMnJGrpg6Qkx4V64a872xG9oNOmK7Xy-n0PrdlIVNOdA>
 <xme:YZ-NZRyGc4RBUumnpZPeyssQJSXKVwRCRPk3CXtwt-lv48AgHUIUJI-gk8OwFLmTM
 _1xjTyzBH3M8WNwQ_o>
X-ME-Received: <xmr:YZ-NZR2a3RCLixk7T3prQDla3NdPmc2msSM1COhAQ4Nziz3femihvayoenqWyxYqBq-1Mg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdefuddgkeekucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeetveegtedthefhudekteehffeu
 keeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:YZ-NZYAYcMRQ9cxX-KEt0psna9SVKUd2sZ7KzrYNkPq3xoDMtybhXA>
 <xmx:YZ-NZdgyASzG2x98H8CM40jT1o2_ydc926McWjeA0WchdLBFC7kayw>
 <xmx:YZ-NZUpSN4Cblj2H9JIG5E0tQgm_3IsLEzJEW9HFMzIeqeCpc8cQWg>
 <xmx:Yp-NZQvDvqjdYDoi08V8YBv8WWY2ElGMIh4sijdx5-JRdUcUcoCoqQ>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 28 Dec 2023 11:16:32 -0500 (EST)
Message-ID: <c7da3cfd-3ea3-4775-8470-ad35d2062470@HIDDEN>
Date: Thu, 28 Dec 2023 18:16:30 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN> <83edfccbwi.fsf@HIDDEN>
 <262157E9-A92C-4063-ADA4-725C156FB227@HIDDEN> <83r0j79522.fsf@HIDDEN>
 <FFBB4602-AEE6-49BB-979E-9205B86F0C45@HIDDEN>
 <b11799ff-11a6-48bb-b9e4-ec5d69fa23c2@HIDDEN> <83tto277s1.fsf@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <83tto277s1.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 67977
Cc: casouri@HIDDEN, dvzubarev@HIDDEN, 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 28/12/2023 15:53, Eli Zaretskii wrote:
>> Date: Thu, 28 Dec 2023 13:44:43 +0200
>> Cc: Denis Zubarev<dvzubarev@HIDDEN>,67977 <at> debbugs.gnu.org
>> From: Dmitry Gutov<dmitry@HIDDEN>
>>
>>>> Could font-lock-dont-widen help, perhaps?
>>> Yes. If font-lock doesn’t widen, then there wouldn’t be back-and-forth reparses.
>> But then treesit major modes will be affected by user narrowing (e.g. if
>> the user narrowed to inside the string, the buffer won't be highlighted
>> as a string).
> Why is that a problem?  When the user narrows the buffer, the part
> outside the narrowing doesn't exist as far as Emacs is concerned.

That's not how it works in most major modes, at least since the 
introduction of font-lock-dont-widen 20 years ago.

Like its docstring says, the exceptions were supposed to be weird modes 
like RMAIL and Info which use narrowing for their own purposes (that 
seems buggy in Info's case, when 'C-x n w' breaks the intended display 
right away). But even Info-mode doesn't actually change 
font-lock-dont-widen, actually, because the apparent behavior would be 
the same. But it could.

I don't have a personal stake in this (I never use narrowing 
interactively). But maybe you'll want to make a poll, to ask the users 
that do.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 28 Dec 2023 13:54:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 28 08:54:02 2023
Received: from localhost ([127.0.0.1]:38737 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rIqpm-0006X9-9K
	for submit <at> debbugs.gnu.org; Thu, 28 Dec 2023 08:54:02 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:51300)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rIqpj-0006Wd-HC
 for 67977 <at> debbugs.gnu.org; Thu, 28 Dec 2023 08:54:01 -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 <eliz@HIDDEN>)
 id 1rIqpb-0005Ck-FP; Thu, 28 Dec 2023 08:53:53 -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=OCSi4XEz6JRBQzPf/3RWt7/vVGhDgmC3GEhR5+kb5TM=; b=PeVVzZ3M9TS/DaRjVxby
 JBbvb/78Me3UDjde1bTe+KDXDXyzBo5BdELC2u57CWu3fXetuwZSkzhV5eB4ennnWV+DkqPMN5OEB
 HeWKuRPY66hK4xVzOlQbqRtKLwcvXDfmBNHxqRAMPUJZxmiyc6kcUq/wkhQJFGwSEuS9T2uKhbFlI
 OhWWtfhcRwJSImi5CkAhXLwTdlXNpXOCutUhBE2wtI+DcsFtjCPg6MoeG9TPiER2RwDq0U7GEADpa
 7KKoft6V7Et9QKJpDh2Wu6Aobs/8paRf410vWZP8+u4ph9YT1enw+cG8BEAiOb5ZHlPeqZYL1hHmK
 x96baUJracLi1Q==;
Date: Thu, 28 Dec 2023 15:53:34 +0200
Message-Id: <83tto277s1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <b11799ff-11a6-48bb-b9e4-ec5d69fa23c2@HIDDEN> (message from
 Dmitry Gutov on Thu, 28 Dec 2023 13:44:43 +0200)
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN> <83edfccbwi.fsf@HIDDEN>
 <262157E9-A92C-4063-ADA4-725C156FB227@HIDDEN> <83r0j79522.fsf@HIDDEN>
 <FFBB4602-AEE6-49BB-979E-9205B86F0C45@HIDDEN>
 <b11799ff-11a6-48bb-b9e4-ec5d69fa23c2@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 67977
Cc: casouri@HIDDEN, dvzubarev@HIDDEN, 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Thu, 28 Dec 2023 13:44:43 +0200
> Cc: Denis Zubarev <dvzubarev@HIDDEN>, 67977 <at> debbugs.gnu.org
> From: Dmitry Gutov <dmitry@HIDDEN>
> 
> >> Could font-lock-dont-widen help, perhaps?
> > Yes. If font-lock doesn’t widen, then there wouldn’t be back-and-forth reparses.
> 
> But then treesit major modes will be affected by user narrowing (e.g. if 
> the user narrowed to inside the string, the buffer won't be highlighted 
> as a string).

Why is that a problem?  When the user narrows the buffer, the part
outside the narrowing doesn't exist as far as Emacs is concerned.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 28 Dec 2023 11:44:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 28 06:44:57 2023
Received: from localhost ([127.0.0.1]:38639 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rIoor-0004tx-1h
	for submit <at> debbugs.gnu.org; Thu, 28 Dec 2023 06:44:57 -0500
Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:54463)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1rIooo-0004tg-Nj
 for 67977 <at> debbugs.gnu.org; Thu, 28 Dec 2023 06:44:55 -0500
Received: from compute7.internal (compute7.nyi.internal [10.202.2.48])
 by mailout.west.internal (Postfix) with ESMTP id 2F8723200A3B;
 Thu, 28 Dec 2023 06:44:49 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute7.internal (MEProxy); Thu, 28 Dec 2023 06:44:49 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm1; t=1703763888;
 x=1703850288; bh=0hMbGBXdvFN8qsNz6b5uGGGaJ5W94yhfCYwjHTp4kfI=; b=
 hSb6dqMzNdOGIKUHnLTZLwOZsGVzm8PH0DJ3FHTzADfEQ7yTuV6a+RhCIk1b3x8X
 rNHGntZDUlJoZOdSlF5JUi8IyQYaOW8Qqvkh1E5JEPnIGd+yMkMlupqZ7iRiBWeh
 fohRlmKYldmGUiYsUcOBIY6bT5LxFhs+opd2hgVcgYq+dj4xih2/A7FkwTZmNVXI
 Qr7JKuTKzF5hOScHZv8oe8GREMpaEBWGo07I345k0ugpesxQ/e0eE7QdC+2kszwQ
 W9I/Ww2z+hhQWHdE6vRQxASV5Qnf7v/N2c24whHIFtAkQbj3Fa43vuadnqBctctU
 RTYdmHyIlHGDpMTlIb9txQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1703763888; x=
 1703850288; bh=0hMbGBXdvFN8qsNz6b5uGGGaJ5W94yhfCYwjHTp4kfI=; b=q
 BSNiV0SpR4fAPLoG2w7dhGVIqIurhLzWqnAuz/9ie6bsHobHVr8NrQytV8IEhohY
 qtwUv+L0hpC5HQmlwxi3Mb1Mq9W7/f/bewRCO68cWP1lgpAMbx4v7dGTmICk/G/H
 LMAhrhfRahXTgZxARJ4/7D3o41jG3huG3zjTl8OYWE7M2b0KEw5cPK6i7KS4/2am
 ljzGtqcAqCrLxF0xPh25UcDQFd/TOn1QPSMI3vI4Zf96cGv5dog5loBFir8l+y1k
 QvNzhQ3G1C8ffcrD7pATK+plK6LkVnmmPa8b5fYsybLsp2qSgCK3MjuJqcyomhbt
 2vv/NF3x2kILr4KI2MJWQ==
X-ME-Sender: <xms:sF-NZSBDzFjtvIwi5NGrk1zxNdogUj4NDxh68-NLCoXIFwsMMiPwcg>
 <xme:sF-NZchwvTxH3uaOCa2S2jRTFUyHzWs1FGL-LtgPSyeP1KxBerSDEL4llV98jgoLG
 Me2Hwb3SqcMtSrCveE>
X-ME-Received: <xmr:sF-NZVkNvW_Iih4zfznA320nvsSspGyQGGj8UZ40BCG1OaS3SvAuk23ncMzJhhlQuO3nIA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdefuddgfeefucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeetveegtedthefhudekteehffeu
 keeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:sF-NZQwRbC4i-fl99JG2D6RvwBsI3T206fiQc-sxpK8zFHTS1EL0Og>
 <xmx:sF-NZXTOpzYBKtD3L90wmm0_YmQXSFRNCqAuUro4a0-BdyG4W0rFWA>
 <xmx:sF-NZba7xXTZUx68lXpaTkLkcL3_QAWEZtZaJ79uaIaiFw5ddcLOnA>
 <xmx:sF-NZSe2auTiRVVk1ADpjK4dc3o1yhtTqzkQKkeiRB8MirBsbjmfww>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 28 Dec 2023 06:44:47 -0500 (EST)
Message-ID: <b11799ff-11a6-48bb-b9e4-ec5d69fa23c2@HIDDEN>
Date: Thu, 28 Dec 2023 13:44:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
To: Yuan Fu <casouri@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN> <83edfccbwi.fsf@HIDDEN>
 <262157E9-A92C-4063-ADA4-725C156FB227@HIDDEN> <83r0j79522.fsf@HIDDEN>
 <FFBB4602-AEE6-49BB-979E-9205B86F0C45@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <FFBB4602-AEE6-49BB-979E-9205B86F0C45@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 67977
Cc: Denis Zubarev <dvzubarev@HIDDEN>, 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 28/12/2023 10:07, Yuan Fu wrote:
> 
>> On Dec 27, 2023, at 4:57 AM, Eli Zaretskii<eliz@HIDDEN>  wrote:
>>
>>> From: Yuan Fu<casouri@HIDDEN>
>>> Date: Tue, 26 Dec 2023 20:15:24 -0800
>>> Cc: Denis Zubarev<dvzubarev@HIDDEN>,
>>> 67977 <at> debbugs.gnu.org
>>>
>>>> Btw, I hope that these calls to 'widen' don't require unnecessary
>>>> reparsing by tree-sitter, do they?
>>> Yes, but only because we called treesit-node-at while the buffer is narrowed, which triggers a reparse. Font-lock and jit-lock themselves always access the parser with widened buffer so they don’t trigger reparse on their own.
>>>
>>> So it seems working in a narrowed buffer would trigger a lot of back-and-fortch reparse. I wonder if it’s worth optimizing for (eg, use two parsers behind the scenes, one for widened buffer and one for narrowed buffer).
>> Could font-lock-dont-widen help, perhaps?
> Yes. If font-lock doesn’t widen, then there wouldn’t be back-and-forth reparses.

But then treesit major modes will be affected by user narrowing (e.g. if 
the user narrowed to inside the string, the buffer won't be highlighted 
as a string).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 28 Dec 2023 08:08:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 28 03:08:10 2023
Received: from localhost ([127.0.0.1]:38374 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rIlR4-0004Vt-0K
	for submit <at> debbugs.gnu.org; Thu, 28 Dec 2023 03:08:10 -0500
Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:53453)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1rIlR2-0004Ve-AB
 for 67977 <at> debbugs.gnu.org; Thu, 28 Dec 2023 03:08:08 -0500
Received: by mail-pf1-x42f.google.com with SMTP id
 d2e1a72fcca58-6d9bf6f24f3so927417b3a.2
 for <67977 <at> debbugs.gnu.org>; Thu, 28 Dec 2023 00:08:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1703750883; x=1704355683; darn=debbugs.gnu.org;
 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=MbgTCYYNBGi4f12t5K9Dv/qNVHGUCl4RHtAZfUXxUME=;
 b=d7lblThSA1mC3fhVkQqjsVfV4FcJCM3xgDNc3Jkq+b5c7d893l5Cr9D+68lDEBenaY
 c/AkSNM1ZiBpWwzQSs+WkdHyqNhGf/sHfdlSJdYIc57li580DxXH7dsFU1yt/EzvU6Fw
 vjM3wVgMzSCXiSFv9GKK/TdcXfVtvwTN4Gs5e/WwVmV7tHa32j9MZ+OAB1QNMy1Jwo5Z
 sluQnKOEG91nw+sakv71nexhR/b43nppP9kdEYplGdM/hCUz8HfDL8adkGBsyGC2N5fZ
 5umVy/Y2g0zL087NN2vIzJd31hn92CCvAHhV5AnmRs9Cr7Q8P2KAOIDzxaTmvkMZebuT
 y/nw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1703750883; x=1704355683;
 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=MbgTCYYNBGi4f12t5K9Dv/qNVHGUCl4RHtAZfUXxUME=;
 b=fTSLQeSZYkL2kJBM3F/ZvP5c7JZ75LmOzGJ9niMtZhAIx2pgGEwaY1gwzXcrCdTmbY
 w2ldh8tneo/fjH4u84DVA5ftPuxI6QjvPGBkmGE3rd6c4GZNfuZJBmID+dufs2yNRUF5
 3zOvafMjR0hyHjnDOipn5u0doJBjAUpzojTW2quhieLujWh91KpCeHK4lDHpSckkv0My
 UPjC+0Bck8FwokZ3DnYO4loLQEGWtTnva8dwmspdsH/uftvw9O2mCmnU2yYxEHUJKDUf
 LT9GW3v0IQitYtGJatpgCB/pOwHSRIsNs/LnastdBqP4uicQ8WoAh3nnetBkPoFh375E
 jIfg==
X-Gm-Message-State: AOJu0YzUr3ea8x0Pi4LiUF6MQC6mylAHBdUUBFhU3khTYjsEyhYa4vNZ
 kxJJDGKEGClr5wsQl2rP0gY=
X-Google-Smtp-Source: AGHT+IHQqNjjta3vYJnKAn7nzMuajdWQp+oa50tZonoh6HWPdX4KEiX4RTK1d33jymJW/DhpmWJzSA==
X-Received: by 2002:a62:8441:0:b0:6d9:3f75:51d5 with SMTP id
 k62-20020a628441000000b006d93f7551d5mr3999732pfd.46.1703750883238; 
 Thu, 28 Dec 2023 00:08:03 -0800 (PST)
Received: from smtpclient.apple (172-117-161-177.res.spectrum.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 v21-20020a056a00149500b006d9cf4b56edsm5249549pfu.175.2023.12.28.00.08.02
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 28 Dec 2023 00:08:02 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\))
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <83r0j79522.fsf@HIDDEN>
Date: Thu, 28 Dec 2023 00:07:51 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <FFBB4602-AEE6-49BB-979E-9205B86F0C45@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN> <83edfccbwi.fsf@HIDDEN>
 <262157E9-A92C-4063-ADA4-725C156FB227@HIDDEN> <83r0j79522.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3731.700.6)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67977
Cc: Denis Zubarev <dvzubarev@HIDDEN>, 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Dec 27, 2023, at 4:57 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
>=20
>> From: Yuan Fu <casouri@HIDDEN>
>> Date: Tue, 26 Dec 2023 20:15:24 -0800
>> Cc: Denis Zubarev <dvzubarev@HIDDEN>,
>> 67977 <at> debbugs.gnu.org
>>=20
>>> Btw, I hope that these calls to 'widen' don't require unnecessary
>>> reparsing by tree-sitter, do they?
>>=20
>> Yes, but only because we called treesit-node-at while the buffer is =
narrowed, which triggers a reparse. Font-lock and jit-lock themselves =
always access the parser with widened buffer so they don=E2=80=99t =
trigger reparse on their own.=20
>>=20
>> So it seems working in a narrowed buffer would trigger a lot of =
back-and-fortch reparse. I wonder if it=E2=80=99s worth optimizing for =
(eg, use two parsers behind the scenes, one for widened buffer and one =
for narrowed buffer).
>=20
> Could font-lock-dont-widen help, perhaps?

Yes. If font-lock doesn=E2=80=99t widen, then there wouldn=E2=80=99t be =
back-and-forth reparses.=20

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 27 Dec 2023 12:58:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 27 07:58:00 2023
Received: from localhost ([127.0.0.1]:35488 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rITTu-0007v9-Tj
	for submit <at> debbugs.gnu.org; Wed, 27 Dec 2023 07:58:00 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:35096)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rITTt-0007uu-8r
 for 67977 <at> debbugs.gnu.org; Wed, 27 Dec 2023 07:57:54 -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 <eliz@HIDDEN>)
 id 1rITTo-0001V7-SO; Wed, 27 Dec 2023 07:57:48 -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=k6gm0N7DqEvAWl+ADSwixVUuJnmE2u/DYwekZmU8CRE=; b=SqFsGA0PicJLVoMPakiX
 NFnC0L3YKk0gXFD99N8bImu89TiBgAJ+TTgR0EtUWSUr5aMsdV/3PcMpsIkOd6CnTY3e9AB5vHoP/
 vJ2pVR8xxwgZvxpIqyDomm8eB6tCxI9m+gyB/NI0xuBUx+lL95837GKSy4jabfMUFDc7P5Mwg7/xY
 /XOqt0uGfwEkfqrkBAQgxj9x67SmJV3KGLW8tgEm72zLsssMx85IdS7HYbHU7UmB0jo9ome6b6t6v
 lFOQ46y4IBznPvbKnpbuUxUzEBK70D1PTisn6C65F3HZCtWP8dKJMVYa/XByZB5rLejCdUqStxsyb
 gk+KL70KRzNrUA==;
Date: Wed, 27 Dec 2023 14:57:09 +0200
Message-Id: <83r0j79522.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <262157E9-A92C-4063-ADA4-725C156FB227@HIDDEN> (message from
 Yuan Fu on Tue, 26 Dec 2023 20:15:24 -0800)
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN> <83edfccbwi.fsf@HIDDEN>
 <262157E9-A92C-4063-ADA4-725C156FB227@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 67977
Cc: dvzubarev@HIDDEN, 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Tue, 26 Dec 2023 20:15:24 -0800
> Cc: Denis Zubarev <dvzubarev@HIDDEN>,
>  67977 <at> debbugs.gnu.org
> 
> > Btw, I hope that these calls to 'widen' don't require unnecessary
> > reparsing by tree-sitter, do they?
> 
> Yes, but only because we called treesit-node-at while the buffer is narrowed, which triggers a reparse. Font-lock and jit-lock themselves always access the parser with widened buffer so they don’t trigger reparse on their own. 
> 
> So it seems working in a narrowed buffer would trigger a lot of back-and-fortch reparse. I wonder if it’s worth optimizing for (eg, use two parsers behind the scenes, one for widened buffer and one for narrowed buffer).

Could font-lock-dont-widen help, perhaps?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 27 Dec 2023 04:15:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 26 23:15:44 2023
Received: from localhost ([127.0.0.1]:35219 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rILKZ-0005Jb-Ix
	for submit <at> debbugs.gnu.org; Tue, 26 Dec 2023 23:15:44 -0500
Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]:45264)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1rILKX-00053Z-3P
 for 67977 <at> debbugs.gnu.org; Tue, 26 Dec 2023 23:15:42 -0500
Received: by mail-ot1-x329.google.com with SMTP id
 46e09a7af769-6dc026661efso281039a34.2
 for <67977 <at> debbugs.gnu.org>; Tue, 26 Dec 2023 20:15:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1703650537; x=1704255337; darn=debbugs.gnu.org;
 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=aDtRq0E9WBe/Ulks3iHYDJn8gYJuapMYG1GVIv1RalY=;
 b=HXBZ8JLcMD0NRNhoeaPjpScu4rvNCLs4qxnkchLA9UvwqFbu2Ra84ZDB6OecRIoEpF
 qD5ugflZH/awFZTfBasmue3IrdgioXx5xFoY5+hrXv66cwG7dtiFOour/vOQafvRM8Wi
 sI5kakrpECaWDke1i5Ta0WSRRbL7YuCt3M53RbzCMYp87xyjWwv5cwYuEZoDIw5s8y9L
 cVfVz/HbvDkUzoCOHRXe0WUvnVvJQa4yFHtVTYtPCisAwk6w8cgeXyPrbiBYcM+lrBI2
 HnE8LrVqIPR0oLcyDEXgPrGlr1zMgSZE3loiAaP9OnOvmOvpmBkgO1WHgZpZFYxDKXBq
 FGeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1703650537; x=1704255337;
 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=aDtRq0E9WBe/Ulks3iHYDJn8gYJuapMYG1GVIv1RalY=;
 b=lk9Dv/b/1fKV8HNSm5hTKw+DPpc27E4HLsF73DeYDdeRVyso/zlyRGbpJ+4wnXvxbZ
 nVl+t+sx0nsftP8JEDc0Y1kprPC2yRWWMWQ+kdQBf/L3o51rXCh+I2XwSoLa4ePh/8HF
 GqAhWoCwpudIhd6cNQvVTnoJTq9zfu0sxCrJ6QDvHzLGb+VuXVLVcK6DRB3GUIEL1d6g
 nefFFJdToUc1iqWPYiAN30qZQ5GKtSjleTCcgPaEAWCFEo4MjdBXxKOdamEe/+3STrf/
 aZe4+O7pfCPtSdeOoW8W213oUoUg6C74jBmb1+hGwXZCrfDEtAbXLdHCjrkdwGI4jZOo
 YSOQ==
X-Gm-Message-State: AOJu0Yx96cCO4YQVBno46+X6YkxN/fC6WEnUuZwtt5HXRRhTBVapw1V1
 X68Q6rl51ETFW5oRmeTtve8=
X-Google-Smtp-Source: AGHT+IG2kvdGKAI5XGsMLYFMU0owRZ0Di8uYzqHq2kKZBisCppwP32i/wlWSMmZVUnf7aMioTGGIzQ==
X-Received: by 2002:a9d:7a8c:0:b0:6d8:8007:d56f with SMTP id
 l12-20020a9d7a8c000000b006d88007d56fmr6643075otn.28.1703650537020; 
 Tue, 26 Dec 2023 20:15:37 -0800 (PST)
Received: from smtpclient.apple (172-117-161-177.res.spectrum.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 l23-20020a62be17000000b006d45fc85962sm10590269pff.55.2023.12.26.20.15.36
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 26 Dec 2023 20:15:36 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\))
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <83edfccbwi.fsf@HIDDEN>
Date: Tue, 26 Dec 2023 20:15:24 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <262157E9-A92C-4063-ADA4-725C156FB227@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN> <83edfccbwi.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3731.700.6)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67977
Cc: Denis Zubarev <dvzubarev@HIDDEN>, 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Dec 23, 2023, at 11:11 PM, Eli Zaretskii <eliz@HIDDEN> wrote:
>=20
>> From: Yuan Fu <casouri@HIDDEN>
>> Date: Sat, 23 Dec 2023 19:00:34 -0800
>> Cc: Denis Zubarev <dvzubarev@HIDDEN>,
>> 67977 <at> debbugs.gnu.org
>>=20
>>>> Yuan, this also happens on the emacs-29 branch, so we should try
>>>> fixing this crash ASAP.
>>>=20
>>> Yeah. The node wants to print it=E2=80=99s type name (with =
ts_node_type), which access it=E2=80=99s parse tree, but the tree is =
already freed, that means the node is outdated and shouldn=E2=80=99t try =
to print it=E2=80=99s type name, but should rather print =E2=80=9Coutdated=
=E2=80=9D.
>>>=20
>>> But simply narrowing the buffer shouldn=E2=80=99t reparse the buffer =
and cause the parse tree to be freed. Anyway, let me see what=E2=80=99s =
going on.
>>=20
>>=20
>> I pushed a fix and now it shouldn=E2=80=99t crash anymore. However, =
I=E2=80=99m yet not sure why at some point the buffer was widened. Is =
there any way to track who called widen?
>=20
> Run Emacs under GDB with a breakpoint at Fwiden, then look at the
> backtrace.  The command "xbacktrace", defined on src/.gdbinit, will
> show a Lisp backtrace as well.
>=20
> But I already did the above, and the answer is the expected one: it's
> JIT font-lock, which calls font-lock-fontify-region, which does:
>=20
>    (save-restriction
>      (unless font-lock-dont-widen (widen))
>=20
> And if you leave blink-cursor-mode and global-eldoc-mode on (which is
> the default), you have also another caller: jit-lock-context-fontify
> (which is called from a timer).
>=20
> Does this answer your question?

Yes, they do. Many thanks!

> Btw, I hope that these calls to 'widen' don't require unnecessary
> reparsing by tree-sitter, do they?

Yes, but only because we called treesit-node-at while the buffer is =
narrowed, which triggers a reparse. Font-lock and jit-lock themselves =
always access the parser with widened buffer so they don=E2=80=99t =
trigger reparse on their own.=20

So it seems working in a narrowed buffer would trigger a lot of =
back-and-fortch reparse. I wonder if it=E2=80=99s worth optimizing for =
(eg, use two parsers behind the scenes, one for widened buffer and one =
for narrowed buffer).

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 24 Dec 2023 07:12:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 24 02:12:19 2023
Received: from localhost ([127.0.0.1]:51640 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rHIep-0001NM-IK
	for submit <at> debbugs.gnu.org; Sun, 24 Dec 2023 02:12:19 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:56618)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rHIen-0001N9-EY
 for 67977 <at> debbugs.gnu.org; Sun, 24 Dec 2023 02:12:18 -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 <eliz@HIDDEN>)
 id 1rHIeb-0002Mg-Jk; Sun, 24 Dec 2023 02:12:05 -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=0BonIT4h3zmlzgiiNK2ae/PSn6JqlntKCqgelYISdYg=; b=I0B+mjM6XiuZ4ZoZP6AL
 drHZsLqrKZVpImo2JSOxb2GCZzzB0naBvreaXNQs50RDRurAk9Xm9wMMa9OoUq4YWqD2w2qMFiJKN
 qR+RvDg84QZ5HnywzhicHU7g930aRU9b8hg3B43Y4VEWWYuy7WTzcqKS59cbrL+FpbrYQYZl5CBBu
 9StnKF+BRhdh4zLN3ihl9UWcSQZ6zMSn9XXfctIxoU+Og8+ToytW0lrqY/DFZsXx9U3j68FfPssJv
 EonoxYweHemoOzTCpg0y3L5TLitDQXVyYfmvJcZsBlhCk4ae6NgtG0IG7oPVqzbNZ2Eo3FoBPaGnS
 GlaXwypvZV8Ljw==;
Date: Sun, 24 Dec 2023 09:11:57 +0200
Message-Id: <83edfccbwi.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN> (message from
 Yuan Fu on Sat, 23 Dec 2023 19:00:34 -0800)
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
 <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 67977
Cc: dvzubarev@HIDDEN, 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Sat, 23 Dec 2023 19:00:34 -0800
> Cc: Denis Zubarev <dvzubarev@HIDDEN>,
>  67977 <at> debbugs.gnu.org
> 
> >> Yuan, this also happens on the emacs-29 branch, so we should try
> >> fixing this crash ASAP.
> > 
> > Yeah. The node wants to print it’s type name (with ts_node_type), which access it’s parse tree, but the tree is already freed, that means the node is outdated and shouldn’t try to print it’s type name, but should rather print “outdated”.
> > 
> > But simply narrowing the buffer shouldn’t reparse the buffer and cause the parse tree to be freed. Anyway, let me see what’s going on.
> 
> 
> I pushed a fix and now it shouldn’t crash anymore. However, I’m yet not sure why at some point the buffer was widened. Is there any way to track who called widen?

Run Emacs under GDB with a breakpoint at Fwiden, then look at the
backtrace.  The command "xbacktrace", defined on src/.gdbinit, will
show a Lisp backtrace as well.

But I already did the above, and the answer is the expected one: it's
JIT font-lock, which calls font-lock-fontify-region, which does:

    (save-restriction
      (unless font-lock-dont-widen (widen))

And if you leave blink-cursor-mode and global-eldoc-mode on (which is
the default), you have also another caller: jit-lock-context-fontify
(which is called from a timer).

Does this answer your question?

Btw, I hope that these calls to 'widen' don't require unnecessary
reparsing by tree-sitter, do they?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 24 Dec 2023 03:01:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 22:01:15 2023
Received: from localhost ([127.0.0.1]:51548 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rHEjq-0002vu-Td
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2023 22:01:15 -0500
Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]:57582)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1rHEjo-0002nq-Ph
 for 67977 <at> debbugs.gnu.org; Sat, 23 Dec 2023 22:01:13 -0500
Received: by mail-oi1-x22a.google.com with SMTP id
 5614622812f47-3bb85a202c2so1816701b6e.2
 for <67977 <at> debbugs.gnu.org>; Sat, 23 Dec 2023 19:01:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1703386861; x=1703991661; darn=debbugs.gnu.org;
 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=lN4iWefQjStMy7Ujmk302goZHUFh8XvOH6QuLnME52o=;
 b=UUaXHCKcuYWbUODJlHtBxzOkcaR2cVwRQ2ClJ83Haj/kp5PjNYsXipTHh8yzzufr4k
 DQam89t87Kz4P5HsUPughvEtup3riZxB0gVDbsSqAZzW0pKcCP3YS+uSjw8LgdnWb36K
 kWZsYAHinB/J5aqpcHm4YXb20oeNMi88PfkfERry94D9NPEbKMPy7o48C/gD/O4NlaHR
 LFRNMmFiSj0WlPJkt1efJNoXELYQ0QyyPk425LJcnVRukWfKe1D/utxvhen30mVAnVZj
 5jSO168SaekMLnKjHfyJmSFqYqgQXYYaH6O8OSklX5zB+JeNhCRvtau/OKgpqswG6l1+
 GGJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1703386861; x=1703991661;
 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=lN4iWefQjStMy7Ujmk302goZHUFh8XvOH6QuLnME52o=;
 b=UVAIlcgzNjgvEH93WPQf/6vpu+73r6r7B0jXqbmVHM+FEM0cqtnteqspk/NOwIe+iU
 LhBGEbSB2HKXH/Wa+Jv+r04UUW3OagHtv+EGJhruMAK1rmKy1TG6G6HQ0Ro7GIH5ewrq
 JLD09H5UL7NjM5ci3nAhqthyg0v3UGhaIpb8vojCjlvjN9fciWgCAK/lHZseQyxWkQVm
 YvrP2rkG+xwtRu1Iki3oVxiulKI0p+Om2qHbN1qsDUQGlKiV451VBV3ELin0/Tzd8+9o
 rRKord5bDtrXKaOkWP4l+RXc8X5bTEGfcLPJ2mQWtN5xJhegHE8xTGoqO0cG7w4+QztA
 kZHA==
X-Gm-Message-State: AOJu0YxAPBGL8znkej/dk+pex+FRFFAcbJ3F6i5HOxpSjx8soQxgu5rU
 UaaLQRA4ZJptT8kizJ2TuAw=
X-Google-Smtp-Source: AGHT+IE3koi/3Y9yMzq3D+yqyiv7V1zg7+EwysbQNQHhdjv+cZ1nLeAxSqdOTSx7zLvZYSZSeA4dgA==
X-Received: by 2002:a05:6808:4447:b0:3bb:8b7e:7e52 with SMTP id
 ep7-20020a056808444700b003bb8b7e7e52mr4241410oib.119.1703386861445; 
 Sat, 23 Dec 2023 19:01:01 -0800 (PST)
Received: from smtpclient.apple (172-117-161-177.res.spectrum.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 o6-20020a056a001b4600b006d98e42d5desm3353035pfv.193.2023.12.23.19.00.57
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 23 Dec 2023 19:01:00 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\))
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
Date: Sat, 23 Dec 2023 19:00:34 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <08D379EF-1556-4498-8E60-F7972A25752A@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
 <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3731.700.6)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67977
Cc: Denis Zubarev <dvzubarev@HIDDEN>, 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Dec 23, 2023, at 12:08 AM, Yuan Fu <casouri@HIDDEN> wrote:
>=20
>=20
>=20
>> On Dec 22, 2023, at 11:26 PM, Eli Zaretskii <eliz@HIDDEN> wrote:
>>=20
>>> From: Denis Zubarev <dvzubarev@HIDDEN>
>>> Date: Sat, 23 Dec 2023 02:18:20 +0300
>>>=20
>>> 1. emacs -Q
>>> 2. M-x find-file /tmp/t.py
>>> 3. paste there
>>> start=3D1
>>> def _init(self, param1, param2, param3=3DFalse):
>>>   self._param1 =3D param2
>>>   self._param2 =3D param2
>>>   self._param3 =3D param3
>>> 4. python-ts-mode
>>> 5. select two last lines and M-x narrow-to-region
>>> 6. answer all prompts
>>> 7. Put cursor on the last self
>>> 8. M-x eval-expression
>>> (progn
>>> (setq temp-node (treesit-node-at (point)))
>>> (sit-for 2)
>>> (garbage-collect)
>>> (message "node %s" temp-node))
>>> 9. Emacs crashes or prints node that contains garbage
>>=20
>> Thanks.
>>=20
>> Yuan, this also happens on the emacs-29 branch, so we should try
>> fixing this crash ASAP.
>=20
> Yeah. The node wants to print it=E2=80=99s type name (with =
ts_node_type), which access it=E2=80=99s parse tree, but the tree is =
already freed, that means the node is outdated and shouldn=E2=80=99t try =
to print it=E2=80=99s type name, but should rather print =E2=80=9Coutdated=
=E2=80=9D.
>=20
> But simply narrowing the buffer shouldn=E2=80=99t reparse the buffer =
and cause the parse tree to be freed. Anyway, let me see what=E2=80=99s =
going on.


I pushed a fix and now it shouldn=E2=80=99t crash anymore. However, =
I=E2=80=99m yet not sure why at some point the buffer was widened. Is =
there any way to track who called widen?

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 23 Dec 2023 08:09:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 03:09:17 2023
Received: from localhost ([127.0.0.1]:48461 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rGx4O-0001h7-QL
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2023 03:09:17 -0500
Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:49661)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1rGx4L-0001gs-Rk
 for 67977 <at> debbugs.gnu.org; Sat, 23 Dec 2023 03:09:15 -0500
Received: by mail-pl1-x630.google.com with SMTP id
 d9443c01a7336-1d3e8a51e6bso20145735ad.3
 for <67977 <at> debbugs.gnu.org>; Sat, 23 Dec 2023 00:09:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1703318943; x=1703923743; darn=debbugs.gnu.org;
 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=OCTPI0QuznXuyMF7W/VHzGrX+xnOwpL6vrcOInVV3iY=;
 b=Zb1LZuyV7kkt5/U/ly3auYaBae6P3td1YA4NFjWOIeSxXMazXPZl4kD9PahOOqRFFB
 G8dNudt2mEdkyZ5i/X17H7K68qELL5vfyT/MolBN/oR1iaya3ny18LRc2I5On7wJoUlS
 MVxvuJRh0O4YMOKndcqCu4KKIu9JmLVv4z3JKLgS+kZHIJWejw18B6em6lwI6Bw1WOFt
 6rEpMj4vU78jpSn6jeer5Y+xNGXK41UX33biAOqoZwMKXpHqayibuNeVoymT7makICvz
 gZ7os4sltdZNfTCcedO3C/2OFgife4MiAGvdkC0o7eVWj+RGA599sLfsd1/Ym436dL9J
 aWlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1703318943; x=1703923743;
 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=OCTPI0QuznXuyMF7W/VHzGrX+xnOwpL6vrcOInVV3iY=;
 b=gJyeJskHagyuPaotFP4Jg5PqT73xoNh1W39RqE3nO9IqLR2mbxtNCu6GdvtQLu+Gfb
 ybRclDK7PFAS1SNHIAUaVRyxaTV4/mPrVveVIsrMoe2E5C0Q4YGikhxNx55IvuvqIwQV
 e25y5wR0Knb9BzYnwD0NDipLO+kVRNY43r+o2qUYIQXJWkrPGafgEFSabDxhvw/gSJ/Q
 vFBXrqpFPPEYlFz3QRx3tN8QOoajaHWpQrCdSO0zHjQu6GhA49PZHgRy15xgpOlUU0R3
 Y+ZN0nJY2wPqixv4USXA4ndfSWlAJHe0M5+ueE6ZxXKm4+PCS8TCZc+FURP/lyJxtP2M
 t3kw==
X-Gm-Message-State: AOJu0Yxyql/2yJvcS+8Vt8bWK4Nr4B2upIGParl6CTOsv1hIqjxnyeNj
 x8gKODa8I6p3fEHpX850e0A=
X-Google-Smtp-Source: AGHT+IFgzgK9nQpDKheHRCTT2jc7JKWgu7JrVl9XeIMnmrEf/Z/+h4X5id2e5HefTST7F5xCki9Tkw==
X-Received: by 2002:a17:903:2349:b0:1cf:f7c3:1e32 with SMTP id
 c9-20020a170903234900b001cff7c31e32mr2645235plh.27.1703318942644; 
 Sat, 23 Dec 2023 00:09:02 -0800 (PST)
Received: from smtpclient.apple (172-117-161-177.res.spectrum.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 g24-20020a1709029f9800b001d0696e9237sm4557746plq.118.2023.12.23.00.09.02
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 23 Dec 2023 00:09:02 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\))
Subject: Re: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing
 treesit-nodes in a narrowed buffer
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <835y0pfkgr.fsf@HIDDEN>
Date: Sat, 23 Dec 2023 00:08:51 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <1DE32BF7-75D8-4F49-975D-53C782D26016@HIDDEN>
References: <87r0jdddxf.fsf@HIDDEN> <835y0pfkgr.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3731.700.6)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67977
Cc: Denis Zubarev <dvzubarev@HIDDEN>, 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Dec 22, 2023, at 11:26 PM, Eli Zaretskii <eliz@HIDDEN> wrote:
>=20
>> From: Denis Zubarev <dvzubarev@HIDDEN>
>> Date: Sat, 23 Dec 2023 02:18:20 +0300
>>=20
>> 1. emacs -Q
>> 2. M-x find-file /tmp/t.py
>> 3. paste there
>> start=3D1
>> def _init(self, param1, param2, param3=3DFalse):
>>    self._param1 =3D param2
>>    self._param2 =3D param2
>>    self._param3 =3D param3
>> 4. python-ts-mode
>> 5. select two last lines and M-x narrow-to-region
>> 6. answer all prompts
>> 7. Put cursor on the last self
>> 8. M-x eval-expression
>> (progn
>> (setq temp-node (treesit-node-at (point)))
>> (sit-for 2)
>> (garbage-collect)
>> (message "node %s" temp-node))
>> 9. Emacs crashes or prints node that contains garbage
>=20
> Thanks.
>=20
> Yuan, this also happens on the emacs-29 branch, so we should try
> fixing this crash ASAP.

Yeah. The node wants to print it=E2=80=99s type name (with =
ts_node_type), which access it=E2=80=99s parse tree, but the tree is =
already freed, that means the node is outdated and shouldn=E2=80=99t try =
to print it=E2=80=99s type name, but should rather print =E2=80=9Coutdated=
=E2=80=9D.

But simply narrowing the buffer shouldn=E2=80=99t reparse the buffer and =
cause the parse tree to be freed. Anyway, let me see what=E2=80=99s =
going on.

Yuan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at 67977 <at> debbugs.gnu.org:


Received: (at 67977) by debbugs.gnu.org; 23 Dec 2023 07:26:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 02:26:56 2023
Received: from localhost ([127.0.0.1]:48427 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rGwPQ-00014U-3R
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2023 02:26:56 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:45338)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rGwPK-00014D-Tv
 for 67977 <at> debbugs.gnu.org; Sat, 23 Dec 2023 02:26:54 -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 <eliz@HIDDEN>)
 id 1rGwP9-0005An-0Y; Sat, 23 Dec 2023 02:26:39 -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=MSNAx1+kRJyQsyqRip2YUwHXkCqRBOcWv3mQAsOt0yg=; b=ETdFKesHKfN6
 1Jltb+lvKgHbyKnZLGll2gVv931LLd4gNMsmi26RtArS0ZMz91FSePo9m2/ASQipfPDIbOMxtu9A9
 KokaTltZ38HxWtIE8kMwy7AeHe3xwyuq78LWqztbHnAHbjkn+NxvpLge9MYS3uS+Q7GCksCcIqPCN
 /OqO8Ui3mIQ64Ar0zdFbto/XZzp0f1fTVJ7wDz1RRVOrIS6/3246NBb5jE/lIjkXd6f7nqo17X5M7
 7/hC6ArSImH4J2cqDRroY/dfXeYNMRQz2w8g/tADa4iQITYaTCrsoyufiC7DRKkosD5aQjU7xLA9N
 j1+jQZ5twrFAkRjQ+99Nvw==;
Date: Sat, 23 Dec 2023 09:26:28 +0200
Message-Id: <835y0pfkgr.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Denis Zubarev <dvzubarev@HIDDEN>, Yuan Fu <casouri@HIDDEN>
In-Reply-To: <87r0jdddxf.fsf@HIDDEN> (message from Denis Zubarev on Sat, 23
 Dec 2023 02:18:20 +0300)
Subject: Re: bug#67977: 30.0.50;
 tree-sitter: Emacs crashes when accessing treesit-nodes in a narrowed
 buffer
References: <87r0jdddxf.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 67977
Cc: 67977 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Denis Zubarev <dvzubarev@HIDDEN>
> Date: Sat, 23 Dec 2023 02:18:20 +0300
> 
> 1. emacs -Q
> 2. M-x find-file /tmp/t.py
> 3. paste there
> start=1
> def _init(self, param1, param2, param3=False):
>     self._param1 = param2
>     self._param2 = param2
>     self._param3 = param3
> 4. python-ts-mode
> 5. select two last lines and M-x narrow-to-region
> 6. answer all prompts
> 7. Put cursor on the last self
> 8. M-x eval-expression
> (progn
> (setq temp-node (treesit-node-at (point)))
> (sit-for 2)
> (garbage-collect)
> (message "node %s" temp-node))
> 9. Emacs crashes or prints node that contains garbage

Thanks.

Yuan, this also happens on the emacs-29 branch, so we should try
fixing this crash ASAP.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Dec 2023 23:19:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 22 18:19:01 2023
Received: from localhost ([127.0.0.1]:48047 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rGonD-0005HY-8X
	for submit <at> debbugs.gnu.org; Fri, 22 Dec 2023 18:19:01 -0500
Received: from lists.gnu.org ([2001:470:142::17]:53784)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dvzubarev@HIDDEN>) id 1rGon7-0005HE-W6
 for submit <at> debbugs.gnu.org; Fri, 22 Dec 2023 18:18:57 -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 <dvzubarev@HIDDEN>)
 id 1rGomx-0001EH-32
 for bug-gnu-emacs@HIDDEN; Fri, 22 Dec 2023 18:18:43 -0500
Received: from forward102a.mail.yandex.net ([178.154.239.85])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dvzubarev@HIDDEN>)
 id 1rGomr-0002WI-F2
 for bug-gnu-emacs@HIDDEN; Fri, 22 Dec 2023 18:18:42 -0500
Received: from mail-nwsmtp-smtp-production-main-68.vla.yp-c.yandex.net
 (mail-nwsmtp-smtp-production-main-68.vla.yp-c.yandex.net
 [IPv6:2a02:6b8:c0d:1f80:0:640:8386:0])
 by forward102a.mail.yandex.net (Yandex) with ESMTP id E7F19608FB
 for <bug-gnu-emacs@HIDDEN>; Sat, 23 Dec 2023 02:18:29 +0300 (MSK)
Received: by mail-nwsmtp-smtp-production-main-68.vla.yp-c.yandex.net
 (smtp/Yandex) with ESMTPSA id TIZ1hDVpCGk0-9GGebXD0; 
 Sat, 23 Dec 2023 02:18:29 +0300
X-Yandex-Fwd: 1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
 t=1703287109; bh=pNu/ZFjfTV+2hTE3mZyt+eFwuM9r3erHDiq86aS9aF4=;
 h=Message-ID:Date:From:Subject:To;
 b=uyvbiJw3FrDWUSaLjIL27SuuQ2SSNz7FrTSAtYBufZGmQ+jSsnc2ZD9cHhI056RiD
 LmKEITL9Z/6A5yjJn3jSf3xFtRLWRTY4vF30GpOBvqpZ9+Z+4+x2gcMb9S0Zu8sjLQ
 ny9lp4ydrFHAOpB5dlcCQV9FUcakhkkKNEpKXqYQ=
Authentication-Results: mail-nwsmtp-smtp-production-main-68.vla.yp-c.yandex.net;
 dkim=pass header.i=@yandex.ru
From: Denis Zubarev <dvzubarev@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.50; tree-sitter: Emacs crashes when accessing treesit-nodes in
 a narrowed buffer
X-Debbugs-Cc: 
Date: Sat, 23 Dec 2023 02:18:20 +0300
Message-ID: <87r0jdddxf.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=178.154.239.85; envelope-from=dvzubarev@HIDDEN;
 helo=forward102a.mail.yandex.net
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)


Steps to reproduce:
1. emacs -Q
2. M-x find-file /tmp/t.py
3. paste there
start=1
def _init(self, param1, param2, param3=False):
    self._param1 = param2
    self._param2 = param2
    self._param3 = param3
4. python-ts-mode
5. select two last lines and M-x narrow-to-region
6. answer all prompts
7. Put cursor on the last self
8. M-x eval-expression
(progn
(setq temp-node (treesit-node-at (point)))
(sit-for 2)
(garbage-collect)
(message "node %s" temp-node))
9. Emacs crashes or prints node that contains garbage
It should print "node #<treesit-node identifier in 112-116>"
It works ok in the widen buffer or if the whole function is narrowed.

Lisp Backtrace:
"message" (0xffffc0c0)
"progn" (0xffffc1e0)
"eval" (0xffffc338)
"eval-expression" (0xffffc440)
"funcall-interactively" (0xffffc438)
"command-execute" (0xffffc7b8)
"execute-extended-command" (0xffffc8f0)
"funcall-interactively" (0xffffc8e8)
"command-execute" (0xffffcc18)

bt:
#0  0x00007ffff338c4f4 in ts_language_symbol_count () at /usr/local/lib/libtree-sitter.so.0
#1  0x00007ffff338c81e in ts_language_symbol_name () at /usr/local/lib/libtree-sitter.so.0
#2  0x0000555555806920 in Ftreesit_node_type (node=node@entry=XIL(0x555556de81d5)) at treesit.c:1864
#3  0x00005555557a3b91 in print_vectorlike_unreadable (buf=0x7fffffff6590 "", escapeflag=false, printcharfun=XIL(0), obj=<optimized out>) at print.c:2049
#4  print_object (obj=<optimized out>, printcharfun=XIL(0), escapeflag=false) at print.c:2633
#5  0x00005555557a4742 in Fprin1_to_string (object=XIL(0x555556de81d5), noescape=XIL(0x30), overrides=overrides@entry=XIL(0)) at print.c:813
#6  0x000055555576f3e8 in styled_format (nargs=<optimized out>, args=<optimized out>, message=<optimized out>) at editfns.c:3662
#7  0x00005555557702e9 in Fformat_message (args=0x7fffffffc0c0, nargs=<optimized out>) at editfns.c:3415
#8  Fmessage (args=0x7fffffffc0c0, nargs=<optimized out>) at editfns.c:3212
#9  Fmessage (nargs=<optimized out>, args=0x7fffffffc0c0) at editfns.c:3181

print treesit_node from frame #2:

$1 = {
  context = {4294928528, 32767, 4294928440, 32767},
  id = 0x7fff20ff67e0,
  tree = 0x5555557a0efc <strout+572>
}




In GNU Emacs 30.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version
 3.24.33, cairo version 1.16.0) of 2023-12-23 built on NUC-here
Repository revision: 9c86dd52475e0ad65359bc964fbe0d62b9d3e464
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Ubuntu 22.04.3 LTS

Configured using:
 'configure --with-modules --with-native-compilation=aot
 --with-imagemagick --with-json --with-tree-sitter --with-xft'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2
M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
SOUND THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2
XPM GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: ru_RU.UTF-8
  value of $LC_NUMERIC: ru_RU.UTF-8
  value of $LC_TIME: ru_RU.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Debbugs

Minor modes in effect:
  winum-mode: t
  global-anzu-mode: t
  anzu-mode: t
  dap-tooltip-mode: t
  dap-ui-many-windows-mode: t
  dap-ui-mode: t
  treemacs-filewatch-mode: t
  treemacs-git-mode: t
  treemacs-fringe-indicator-mode: t
  dap-auto-configure-mode: t
  dap-mode: t
  save-place-mode: t
  global-so-long-mode: t
  global-git-commit-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  recentf-mode: t
  projectile-mode: t
  header-line-indent-mode: t
  which-key-mode: t
  savehist-mode: t
  better-jumper-mode: t
  better-jumper-local-mode: t
  global-company-mode: t
  company-mode: t
  vertico-mode: t
  marginalia-mode: t
  evil-goggles-mode: t
  evil-escape-mode: t
  evil-snipe-override-mode: t
  evil-snipe-mode: t
  pcre-mode: t
  server-mode: t
  gcmh-mode: t
  global-hl-line-mode: t
  hl-line-mode: t
  winner-mode: t
  smartparens-global-mode: t
  ws-butler-global-mode: t
  undo-fu-session-global-mode: t
  undo-fu-mode: t
  global-flycheck-mode: t
  persp-mode: t
  doom-modeline-mode: t
  solaire-global-mode: t
  solaire-mode: t
  hexl-follow-ascii: t
  global-evil-surround-mode: t
  evil-surround-mode: t
  dirvish-override-dired-mode: t
  direnv-mode: t
  +lsp-optimization-mode: t
  evil-mode: t
  evil-local-mode: t
  +popup-mode: t
  override-global-mode: t
  general-override-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  window-divider-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/denin/.emacs.d/.local/straight/build-30.0.50/ivy/elpa hides /home/denin/.emacs.d/.local/straight/build-30.0.50/lispy/elpa
/home/denin/.emacs.d/.local/straight/build-30.0.50/transient/transient hides /usr/local/share/emacs/30.0.50/lisp/transient
/home/denin/.emacs.d/.local/straight/build-30.0.50/bind-key/bind-key hides /usr/local/share/emacs/30.0.50/lisp/bind-key
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-delight hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-delight
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-lint hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-lint
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-jump hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-jump
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-diminish hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-diminish
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-ensure hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-ensure
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-bind-key hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-bind-key
/home/denin/.emacs.d/.local/straight/build-30.0.50/use-package/use-package-core hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-core
/home/denin/.emacs.d/.local/straight/build-30.0.50/project/project hides /usr/local/share/emacs/30.0.50/lisp/progmodes/project
/home/denin/.emacs.d/.local/straight/build-30.0.50/gdb-mi/gdb-mi hides /usr/local/share/emacs/30.0.50/lisp/progmodes/gdb-mi
/home/denin/.emacs.d/.local/straight/build-30.0.50/xref/xref hides /usr/local/share/emacs/30.0.50/lisp/progmodes/xref
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-ref hides /usr/local/share/emacs/30.0.50/lisp/org/ob-ref
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-irc hides /usr/local/share/emacs/30.0.50/lisp/org/ol-irc
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-crypt hides /usr/local/share/emacs/30.0.50/lisp/org/org-crypt
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-attach hides /usr/local/share/emacs/30.0.50/lisp/org/org-attach
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-mouse hides /usr/local/share/emacs/30.0.50/lisp/org/org-mouse
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-latex hides /usr/local/share/emacs/30.0.50/lisp/org/ob-latex
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-eww hides /usr/local/share/emacs/30.0.50/lisp/org/ol-eww
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-ditaa hides /usr/local/share/emacs/30.0.50/lisp/org/ob-ditaa
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-groovy hides /usr/local/share/emacs/30.0.50/lisp/org/ob-groovy
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-compat hides /usr/local/share/emacs/30.0.50/lisp/org/org-compat
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-info hides /usr/local/share/emacs/30.0.50/lisp/org/ol-info
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-protocol hides /usr/local/share/emacs/30.0.50/lisp/org/org-protocol
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-footnote hides /usr/local/share/emacs/30.0.50/lisp/org/org-footnote
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-id hides /usr/local/share/emacs/30.0.50/lisp/org/org-id
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/oc-biblatex hides /usr/local/share/emacs/30.0.50/lisp/org/oc-biblatex
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-C hides /usr/local/share/emacs/30.0.50/lisp/org/ob-C
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-colview hides /usr/local/share/emacs/30.0.50/lisp/org/org-colview
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-calc hides /usr/local/share/emacs/30.0.50/lisp/org/ob-calc
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-octave hides /usr/local/share/emacs/30.0.50/lisp/org/ob-octave
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-java hides /usr/local/share/emacs/30.0.50/lisp/org/ob-java
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-js hides /usr/local/share/emacs/30.0.50/lisp/org/ob-js
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-R hides /usr/local/share/emacs/30.0.50/lisp/org/ob-R
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-ruby hides /usr/local/share/emacs/30.0.50/lisp/org/ob-ruby
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-css hides /usr/local/share/emacs/30.0.50/lisp/org/ob-css
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-odt hides /usr/local/share/emacs/30.0.50/lisp/org/ox-odt
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-man hides /usr/local/share/emacs/30.0.50/lisp/org/ol-man
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-perl hides /usr/local/share/emacs/30.0.50/lisp/org/ob-perl
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-org hides /usr/local/share/emacs/30.0.50/lisp/org/ox-org
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-html hides /usr/local/share/emacs/30.0.50/lisp/org/ox-html
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-gnuplot hides /usr/local/share/emacs/30.0.50/lisp/org/ob-gnuplot
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-entities hides /usr/local/share/emacs/30.0.50/lisp/org/org-entities
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-bibtex hides /usr/local/share/emacs/30.0.50/lisp/org/ol-bibtex
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-goto hides /usr/local/share/emacs/30.0.50/lisp/org/org-goto
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob hides /usr/local/share/emacs/30.0.50/lisp/org/ob
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-inlinetask hides /usr/local/share/emacs/30.0.50/lisp/org/org-inlinetask
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-comint hides /usr/local/share/emacs/30.0.50/lisp/org/ob-comint
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-gnus hides /usr/local/share/emacs/30.0.50/lisp/org/ol-gnus
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-latex hides /usr/local/share/emacs/30.0.50/lisp/org/ox-latex
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-version hides /usr/local/share/emacs/30.0.50/lisp/org/org-version
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-agenda hides /usr/local/share/emacs/30.0.50/lisp/org/org-agenda
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-lisp hides /usr/local/share/emacs/30.0.50/lisp/org/ob-lisp
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-matlab hides /usr/local/share/emacs/30.0.50/lisp/org/ob-matlab
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org hides /usr/local/share/emacs/30.0.50/lisp/org/org
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-maxima hides /usr/local/share/emacs/30.0.50/lisp/org/ob-maxima
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-lua hides /usr/local/share/emacs/30.0.50/lisp/org/ob-lua
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-refile hides /usr/local/share/emacs/30.0.50/lisp/org/org-refile
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-faces hides /usr/local/share/emacs/30.0.50/lisp/org/org-faces
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-python hides /usr/local/share/emacs/30.0.50/lisp/org/ob-python
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-loaddefs hides /usr/local/share/emacs/30.0.50/lisp/org/org-loaddefs
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-lint hides /usr/local/share/emacs/30.0.50/lisp/org/org-lint
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-docview hides /usr/local/share/emacs/30.0.50/lisp/org/ol-docview
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-md hides /usr/local/share/emacs/30.0.50/lisp/org/ox-md
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-man hides /usr/local/share/emacs/30.0.50/lisp/org/ox-man
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-indent hides /usr/local/share/emacs/30.0.50/lisp/org/org-indent
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-mobile hides /usr/local/share/emacs/30.0.50/lisp/org/org-mobile
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-scheme hides /usr/local/share/emacs/30.0.50/lisp/org/ob-scheme
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox hides /usr/local/share/emacs/30.0.50/lisp/org/ox
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-tangle hides /usr/local/share/emacs/30.0.50/lisp/org/ob-tangle
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/oc-csl hides /usr/local/share/emacs/30.0.50/lisp/org/oc-csl
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-shell hides /usr/local/share/emacs/30.0.50/lisp/org/ob-shell
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-beamer hides /usr/local/share/emacs/30.0.50/lisp/org/ox-beamer
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/oc-natbib hides /usr/local/share/emacs/30.0.50/lisp/org/oc-natbib
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-habit hides /usr/local/share/emacs/30.0.50/lisp/org/org-habit
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-emacs-lisp hides /usr/local/share/emacs/30.0.50/lisp/org/ob-emacs-lisp
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-persist hides /usr/local/share/emacs/30.0.50/lisp/org/org-persist
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-core hides /usr/local/share/emacs/30.0.50/lisp/org/ob-core
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-icalendar hides /usr/local/share/emacs/30.0.50/lisp/org/ox-icalendar
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-haskell hides /usr/local/share/emacs/30.0.50/lisp/org/ob-haskell
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-attach-git hides /usr/local/share/emacs/30.0.50/lisp/org/org-attach-git
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/oc hides /usr/local/share/emacs/30.0.50/lisp/org/oc
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-sed hides /usr/local/share/emacs/30.0.50/lisp/org/ob-sed
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-pcomplete hides /usr/local/share/emacs/30.0.50/lisp/org/org-pcomplete
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-koma-letter hides /usr/local/share/emacs/30.0.50/lisp/org/ox-koma-letter
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-list hides /usr/local/share/emacs/30.0.50/lisp/org/org-list
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-ctags hides /usr/local/share/emacs/30.0.50/lisp/org/org-ctags
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-dot hides /usr/local/share/emacs/30.0.50/lisp/org/ob-dot
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-rmail hides /usr/local/share/emacs/30.0.50/lisp/org/ol-rmail
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-forth hides /usr/local/share/emacs/30.0.50/lisp/org/ob-forth
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-sqlite hides /usr/local/share/emacs/30.0.50/lisp/org/ob-sqlite
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-cycle hides /usr/local/share/emacs/30.0.50/lisp/org/org-cycle
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-num hides /usr/local/share/emacs/30.0.50/lisp/org/org-num
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-src hides /usr/local/share/emacs/30.0.50/lisp/org/org-src
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-sql hides /usr/local/share/emacs/30.0.50/lisp/org/ob-sql
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-plot hides /usr/local/share/emacs/30.0.50/lisp/org/org-plot
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-clock hides /usr/local/share/emacs/30.0.50/lisp/org/org-clock
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-element hides /usr/local/share/emacs/30.0.50/lisp/org/org-element
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-ascii hides /usr/local/share/emacs/30.0.50/lisp/org/ox-ascii
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-mhe hides /usr/local/share/emacs/30.0.50/lisp/org/ol-mhe
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-table hides /usr/local/share/emacs/30.0.50/lisp/org/ob-table
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-plantuml hides /usr/local/share/emacs/30.0.50/lisp/org/ob-plantuml
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-texinfo hides /usr/local/share/emacs/30.0.50/lisp/org/ox-texinfo
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-ocaml hides /usr/local/share/emacs/30.0.50/lisp/org/ob-ocaml
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-datetree hides /usr/local/share/emacs/30.0.50/lisp/org/org-datetree
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-doi hides /usr/local/share/emacs/30.0.50/lisp/org/ol-doi
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-macs hides /usr/local/share/emacs/30.0.50/lisp/org/org-macs
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-macro hides /usr/local/share/emacs/30.0.50/lisp/org/org-macro
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/oc-basic hides /usr/local/share/emacs/30.0.50/lisp/org/oc-basic
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-fold hides /usr/local/share/emacs/30.0.50/lisp/org/org-fold
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-exp hides /usr/local/share/emacs/30.0.50/lisp/org/ob-exp
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-capture hides /usr/local/share/emacs/30.0.50/lisp/org/org-capture
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-fortran hides /usr/local/share/emacs/30.0.50/lisp/org/ob-fortran
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-lob hides /usr/local/share/emacs/30.0.50/lisp/org/ob-lob
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-awk hides /usr/local/share/emacs/30.0.50/lisp/org/ob-awk
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol hides /usr/local/share/emacs/30.0.50/lisp/org/ol
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-w3m hides /usr/local/share/emacs/30.0.50/lisp/org/ol-w3m
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-makefile hides /usr/local/share/emacs/30.0.50/lisp/org/ob-makefile
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-lilypond hides /usr/local/share/emacs/30.0.50/lisp/org/ob-lilypond
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-archive hides /usr/local/share/emacs/30.0.50/lisp/org/org-archive
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-processing hides /usr/local/share/emacs/30.0.50/lisp/org/ob-processing
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-eshell hides /usr/local/share/emacs/30.0.50/lisp/org/ob-eshell
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-julia hides /usr/local/share/emacs/30.0.50/lisp/org/ob-julia
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-sass hides /usr/local/share/emacs/30.0.50/lisp/org/ob-sass
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-screen hides /usr/local/share/emacs/30.0.50/lisp/org/ob-screen
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/oc-bibtex hides /usr/local/share/emacs/30.0.50/lisp/org/oc-bibtex
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-duration hides /usr/local/share/emacs/30.0.50/lisp/org/org-duration
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-org hides /usr/local/share/emacs/30.0.50/lisp/org/ob-org
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-tempo hides /usr/local/share/emacs/30.0.50/lisp/org/org-tempo
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-bbdb hides /usr/local/share/emacs/30.0.50/lisp/org/ol-bbdb
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-fold-core hides /usr/local/share/emacs/30.0.50/lisp/org/org-fold-core
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-clojure hides /usr/local/share/emacs/30.0.50/lisp/org/ob-clojure
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-timer hides /usr/local/share/emacs/30.0.50/lisp/org/org-timer
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-keys hides /usr/local/share/emacs/30.0.50/lisp/org/org-keys
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ob-eval hides /usr/local/share/emacs/30.0.50/lisp/org/ob-eval
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-table hides /usr/local/share/emacs/30.0.50/lisp/org/org-table
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ol-eshell hides /usr/local/share/emacs/30.0.50/lisp/org/ol-eshell
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/ox-publish hides /usr/local/share/emacs/30.0.50/lisp/org/ox-publish
/home/denin/.emacs.d/.local/straight/build-30.0.50/org/org-feed hides /usr/local/share/emacs/30.0.50/lisp/org/org-feed
/home/denin/.emacs.d/.local/straight/build-30.0.50/soap-client/soap-inspect hides /usr/local/share/emacs/30.0.50/lisp/net/soap-inspect
/home/denin/.emacs.d/.local/straight/build-30.0.50/soap-client/soap-client hides /usr/local/share/emacs/30.0.50/lisp/net/soap-client
/home/denin/.emacs.d/.local/straight/build-30.0.50/eldoc/eldoc hides /usr/local/share/emacs/30.0.50/lisp/emacs-lisp/eldoc
/home/denin/.emacs.d/.local/straight/build-30.0.50/map/map hides /usr/local/share/emacs/30.0.50/lisp/emacs-lisp/map

Features:
(shadow hide-mode-line go-translate gts-engine-youdao
gts-engine-stardict gts-engine-deepl gts-engine-google-rpc
gts-engine-google gts-engine-bing gts-implements gts-faces gts-core
evil-args emacsbug vertico-directory winum sort smiley gnus-cite textsec
uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check
gnus-async gnus-bcklg qp gnus-ml nndoc gnus-agent gnus-srvr gnus-score
score-mode nnvirtual gnus-msg nntp gnus-cache gnus-dup gnus-art mm-uu
mml2015 mm-view mml-smime smime dig gnus-sum gnus-group gnus-undo
gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo
gnus-spec gnus-int gnus-range gnus-win evil-collection-gnus gnus
nnheader range mm-archive url-cache evil-collection-tabulated-list
debbugs-gnu debbugs-compat evil-collection-debbugs debbugs soap-client
rng-xsd rng-dt rng-util xsd-regexp mule-util vertico-quick dumb-jump
evil-anzu anzu git-gutter-fringe fringe-helper git-gutter vc
bug-reference macrostep-c cmacexp evil-collection-macrostep macrostep
rainbow-delimiters tramp-archive tramp-gvfs dbus org-capture org-agenda
the-org-mode-expansions evil-collection-org smartparens-org org-yt
org-element org-persist org-id org-refile org-element-ast avl-tree org
ob-emacs-lisp org-table org-loaddefs evil-collection-calendar cal-menu
calendar cal-loaddefs ob ob-tangle ol ob-ref ob-lob ob-table ob-exp
org-macro org-src evil-collection-sh-script sh-script smie executable
ob-comint org-pcomplete org-list org-footnote org-entities
evil-collection-indent lsp-diagnostics lsp-headerline lsp-icons
lsp-modeline lsp-ui lsp-ui-flycheck lsp-ui-doc
evil-collection-lsp-ui-imenu lsp-ui-imenu lsp-ui-peek lsp-ui-sideline
lsp-ui-util lsp-zig lsp-tilt lsp-steep lsp-svelte lsp-sqls
lsp-ruby-syntax-tree lsp-ruby-lsp lsp-yaml lsp-xml lsp-vimscript
lsp-vhdl lsp-volar lsp-vetur lsp-html lsp-verilog lsp-vala lsp-v
lsp-typeprof lsp-ttcn3 lsp-toml lsp-terraform lsp-tex lsp-sorbet
lsp-solargraph lsp-semgrep lsp-rust lsp-rubocop lsp-rf lsp-ruff-lsp
lsp-remark lsp-racket lsp-r lsp-purescript lsp-pylsp lsp-pyls lsp-pwsh
lsp-php lsp-pls lsp-perlnavigator lsp-perl lsp-openscad lsp-ocaml
lsp-magik lsp-nix lsp-nim lsp-nginx lsp-move lsp-mint lsp-marksman
lsp-markdown lsp-lua lsp-kotlin lsp-json lsp-javascript lsp-idris
lsp-haxe lsp-groovy lsp-hack lsp-graphql lsp-glsl lsp-gleam lsp-go
lsp-completion lsp-gdscript lsp-fsharp lsp-fortran lsp-eslint lsp-erlang
lsp-emmet lsp-elixir lsp-elm lsp-dockerfile lsp-dhall lsp-d lsp-css
lsp-csharp gnutls lsp-crystal lsp-credo lsp-cmake lsp-clojure
lsp-semantic-tokens lsp-clangd lsp-beancount lsp-bash lsp-astro lsp-awk
lsp-ansible lsp-angular lsp-ada lsp-actionscript evil-collection-vc-git
vc-git vc-dispatcher jka-compr auto-minor-mode evil-ts-obj
evil-ts-obj-yaml evil-ts-obj-nix evil-ts-obj-cpp evil-ts-obj-bash
evil-ts-obj-python evil-ts-obj-avy evil-ts-obj-core evil-ts-obj-util
evil-ts-obj-conf cus-start outli org-faces org-keys oc lsp-pyright
dap-gdb-lldb dap-utils dap-lldb ccls ccls-member-hierarchy
ccls-inheritance-hierarchy ccls-call-hierarchy ccls-tree ccls-code-lens
ccls-semantic-highlight ccls-common smartparens-c cc-mode-expansions
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs dap-mouse dap-ui lsp-treemacs lsp-treemacs-generic
lsp-treemacs-themes treemacs-treelib treemacs-persp treemacs-projectile
treemacs-evil treemacs-nerd-icons treemacs treemacs-header-line
treemacs-compatibility treemacs-mode treemacs-bookmarks treemacs-tags
treemacs-interface treemacs-persistence treemacs-filewatch-mode
treemacs-follow-mode treemacs-rendering treemacs-annotations
treemacs-async treemacs-workspaces treemacs-dom treemacs-visuals
treemacs-fringe-indicator treemacs-faces treemacs-icons treemacs-scope
treemacs-themes treemacs-core-utils pfuture treemacs-logging
treemacs-customization treemacs-macros gdb-mi gdb-module hydra bui
bui-list bui-info bui-entry bui-core bui-history bui-button bui-utils
lsp-lens dap-python dap-mode dap-tasks dap-launch lsp-docker yaml
posframe dap-overlays lsp-mode lsp-protocol evil-collection-xref xref
spinner network-stream smartparens-markdown
evil-collection-markdown-mode markdown-mode edit-indirect noutline
outline lv inline ewoc hl-todo smartparens-python
python-el-fgallina-expansions pyvenv evil-collection-python python
saveplace evil-collection-so-long so-long delsel
evil-collection-minibuffer vertico-repeat tramp-sh jupyter-tramp
tramp-cache time-stamp jupyter-server jupyter-server-kernel jupyter-repl
jupyter-widget-client simple-httpd jupyter-client jupyter-kernel
jupyter-kernelspec jupyter-env jupyter-monads thunk jupyter-messages
hmac-def jupyter-mime shr pixel-fill kinsoku url-file svg xml
jupyter-rest-api url-http url-auth url-gw nsm websocket bindat
jupyter-base eieio-base tramp trampver tramp-integration tramp-message
tramp-compat xdg parse-time iso8601 tramp-loaddefs magit-diff
smerge-mode diff magit-core magit-autorevert magit-margin
magit-transient magit-process magit-mode git-commit magit-git magit-base
evil-collection-magit-section magit-section cursor-sensor crm
evil-collection-log-edit log-edit pcvs-util add-log with-editor
doom-snippets doom-snippets-lib yasnippet evil-collection-elisp-mode
elisp-mode recentf tree-widget projectile project evil-collection-grep
grep ibuffer-vc ibuf-ext evil-collection-ibuffer ibuffer
ibuffer-loaddefs mail-extr flycheck-popup-tip evil-collection-popup
popup vi-tilde-fringe display-line-numbers jinx message sendmail
yank-media puny rfc822 mml mml-sec evil-collection-epa epa epg rfc6068
epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils
gmm-utils mailheader time-date evil-collection-which-key which-key
savehist better-jumper company-capf company-fuzzy ht ffap company
evil-collection-vertico vertico orderless marginalia evil-goggles
evil-easymotion evil-escape evil-snipe pcre2el rxt re-builder quail
ace-window avy evil-nerd-commenter evil-nerd-commenter-operator
evil-nerd-commenter-sdk smartparens-html html-mode-expansions sgml-mode
facemenu dom consult-flycheck evil-collection-consult consult
evil-collection-bookmark bookmark server pulse color autorevert
filenotify gcmh hl-line winner smartparens-config smartparens-text
smartparens loadhist ws-butler undo-fu-session undo-fu flycheck-package
package-lint evil-collection-imenu imenu evil-collection-finder finder
finder-inf lisp-mnt evil-collection-package-menu doom-packages package
browse-url url-handlers evil-collection-flycheck flycheck persp-mode
doom-modeline doom-modeline-segments doom-modeline-env
doom-modeline-core shrink-path f f-shortdoc shortdoc nerd-icons
nerd-icons-faces nerd-icons-data nerd-icons-data-mdicon
nerd-icons-data-flicon nerd-icons-data-codicon nerd-icons-data-devicon
nerd-icons-data-sucicon nerd-icons-data-wicon nerd-icons-data-faicon
nerd-icons-data-powerline nerd-icons-data-octicon
nerd-icons-data-pomicon nerd-icons-data-ipsicon doom-themes-ext-org
solaire-mode face-remap spacemacs-light-theme spacemacs-theme
chatgpt-shell shell-maker evil-collection-view view shell goto-addr
highlight-numbers parent-mode ielm find-func evil-collection-eshell
em-prompt eshell esh-mode esh-var esh-cmd generator esh-ext esh-opt
esh-proc esh-io esh-arg pcomplete esh-module esh-groups esh-util files-x
nhexl-mode disp-table hexl ascii-table evil-embrace embrace
expand-region text-mode-expansions er-basic-expansions
expand-region-core expand-region-custom evil-surround let-alist ob-core
org-cycle org-fold org-fold-core org-compat ob-eval org-version org-macs
turbo-log s evil-textobj-tree-sitter
evil-textobj-tree-sitter-thing-at-point evil-textobj-tree-sitter-core
treesit-langs treesit-faces treesit-langs-build dtrt-indent
evil-collection-tar-mode tar-mode evil-collection-arc-mode arc-mode
archive-mode url url-proxy url-privacy url-expand url-methods
url-history url-cookie generate-lisp-file url-domsuf url-util url-parse
auth-source password-cache url-vars mailcap treesit delight tree-sitter
tree-sitter-load tree-sitter-cli tsc tsc-dyn tsc-dyn-get
evil-collection-compile compile text-property-search
evil-collection-comint comint ansi-osc ansi-color dired-aux
dired-rainbow dired-hacks-utils dirvish transient format-spec eieio
eieio-core compat evil-collection-dired dired dired-loaddefs
tsc-obsolete direnv json map evil-collection-diff-mode
evil-collection-custom cus-edit cus-load wid-edit evil-collection
annalist diff-mode dash use-package-delight ibuf-macs targets evil
evil-integration evil-maps evil-commands reveal evil-jumps
evil-command-window evil-types evil-search evil-macros evil-repeat
evil-states evil-core advice evil-common thingatpt rect evil-vars ring
derived edmacro kmacro byte-opt use-package-bind-key bind-key comp
comp-cstr warnings icons comp-run comp-common rx doom-editor
doom-projects doom-ui easy-mmode doom-keybinds pp cl-extra help-mode
use-package-core bytecomp byte-compile general tex-site doom-start
doom-modules cl-seq doom doom-lib cl-macs cl-loaddefs cl-lib pcase gv
harfbuzz jansson dynamic-modules subr-x rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo gtk
x-toolkit xinput2 x multi-tty move-toolbar make-network-process
native-compile emacs)

Memory information:
((conses 16 1704985 365936) (symbols 48 99737 3) (strings 32 355138 61068)
 (string-bytes 1 10376606) (vectors 16 185907) (vector-slots 8 3346556 129426)
 (floats 8 4450 11060) (intervals 56 62765 2766) (buffers 992 35))




Acknowledgement sent to Denis Zubarev <dvzubarev@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#67977; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 9 Apr 2024 04:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.