From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#67977: 30.0.50; tree-sitter: Emacs crashes when accessing treesit-nodes in a narrowed buffer Date: Thu, 28 Dec 2023 18:16:30 +0200 Message-ID: References: <87r0jdddxf.fsf@yandex.ru> <835y0pfkgr.fsf@gnu.org> <1DE32BF7-75D8-4F49-975D-53C782D26016@gmail.com> <08D379EF-1556-4498-8E60-F7972A25752A@gmail.com> <83edfccbwi.fsf@gnu.org> <262157E9-A92C-4063-ADA4-725C156FB227@gmail.com> <83r0j79522.fsf@gnu.org> <83tto277s1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37125"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: casouri@gmail.com, dvzubarev@yandex.ru, 67977@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 28 17:17:23 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rIt4T-0009Qs-0u for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Dec 2023 17:17:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIt4D-0005q2-Ax; Thu, 28 Dec 2023 11:17:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rIt4B-0005pp-PI for bug-gnu-emacs@gnu.org; Thu, 28 Dec 2023 11:17:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rIt4A-0001Xi-OE for bug-gnu-emacs@gnu.org; Thu, 28 Dec 2023 11:17:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rIt49-00033F-Oe for bug-gnu-emacs@gnu.org; Thu, 28 Dec 2023 11:17:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Dec 2023 16:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67977 X-GNU-PR-Package: emacs Original-Received: via spool by 67977-submit@debbugs.gnu.org id=B67977.170378020211700 (code B ref 67977); Thu, 28 Dec 2023 16:17:01 +0000 Original-Received: (at 67977) by debbugs.gnu.org; 28 Dec 2023 16:16:42 +0000 Original-Received: from localhost ([127.0.0.1]:40215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIt3p-00032d-GX for submit@debbugs.gnu.org; Thu, 28 Dec 2023 11:16:41 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:59339) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIt3n-00032O-9k for 67977@debbugs.gnu.org; Thu, 28 Dec 2023 11:16:40 -0500 Original-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) Original-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: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdefuddgkeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeetveegtedthefhudekteehffeu keeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 28 Dec 2023 11:16:32 -0500 (EST) Content-Language: en-US In-Reply-To: <83tto277s1.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276984 Archived-At: On 28/12/2023 15:53, Eli Zaretskii wrote: >> Date: Thu, 28 Dec 2023 13:44:43 +0200 >> Cc: Denis Zubarev,67977@debbugs.gnu.org >> From: Dmitry Gutov >> >>>> 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.