From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes Date: Sat, 25 Mar 2023 17:09:33 +0300 Message-ID: <831qlcdisi.fsf@gnu.org> References: <87fs9yur7r.fsf@gmail.com> <2fd8f2b8-d9c4-c825-a789-f2d42324859f@yandex.ru> <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@gmail.com> <83h6uc549z.fsf@gnu.org> <665745A2-FDC8-45DE-BFF5-2F688FC85431@gmail.com> <491b788f-c3c3-4877-daa0-f515be9f3a17@yandex.ru> <83sfduelab.fsf@gnu.org> <8FC25A01-6934-43BB-899C-CA5926BEA3CF@gmail.com> <83jzz5c8ml.fsf@gnu.org> <83edpdc6sn.fsf@gnu.org> <1ca302bf-99dc-7f9e-8544-063064a1cb21@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12740"; mail-complaints-to="usenet@ciao.gmane.io" Cc: wkirschbaum@gmail.com, casouri@gmail.com, 62333@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 25 15:10:13 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 1pg4az-00034b-JR for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Mar 2023 15:10:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pg4aq-0006Sx-BZ; Sat, 25 Mar 2023 10:10:04 -0400 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 1pg4ao-0006So-Ti for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 10:10:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pg4ao-0008AO-Kj for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 10:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pg4ao-00080l-Ar for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 10:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Mar 2023 14:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62333 X-GNU-PR-Package: emacs Original-Received: via spool by 62333-submit@debbugs.gnu.org id=B62333.167975338530763 (code B ref 62333); Sat, 25 Mar 2023 14:10:02 +0000 Original-Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 14:09:45 +0000 Original-Received: from localhost ([127.0.0.1]:43143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg4aW-000807-Tw for submit@debbugs.gnu.org; Sat, 25 Mar 2023 10:09:45 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg4aU-0007zr-TK for 62333@debbugs.gnu.org; Sat, 25 Mar 2023 10:09:43 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pg4aO-00083g-5a; Sat, 25 Mar 2023 10:09:36 -0400 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=9/wEqtfv6BBUOcYtmXkJ+DEGgxlo2moU5PETsbh1wfI=; b=EXlxMt9T+mNV KkyWnsdBLTMt8OHh++W0vw4Bvk5XLyU6nawxJzVdxs3Q/4COxzPqnSQxmBvABVLySD1+gPcbB/xjz LgSN7W15L0TORO1cRCNMN9g/7MmP2gtfP0QSby8ZS6RW6BtuZJLgrlN+RX5UDUU+FaowhueAXYSPp jyOh/IuGw555JRueGU9iErKNvJfMi13jWxZqNN196x14ENYIipGNFjN4PgNtLciRhns+XJX1MBwO6 yRF2HDJtQ4Z96O6SC8Pl36fdTBJgF7m25xTVRx8CmC5uK9/H7Lmwr+MsZBMPaAoaNs9fFemVW584g Y18or7yJ92CMdDncfd4XtQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pg4aN-00013y-DW; Sat, 25 Mar 2023 10:09:35 -0400 In-Reply-To: <1ca302bf-99dc-7f9e-8544-063064a1cb21@yandex.ru> (message from Dmitry Gutov on Sat, 25 Mar 2023 15:44:18 +0200) 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:258575 Archived-At: > Date: Sat, 25 Mar 2023 15:44:18 +0200 > Cc: wkirschbaum@gmail.com, casouri@gmail.com, 62333@debbugs.gnu.org > From: Dmitry Gutov > > > If that's the only reason, then tree-sitter based modes could widen > > back in their sexp-moving functions, since they use the parse data for > > this, right? > > Not necessarily: it doesn't know the purpose for which the narrowing was > applied. Could be for a mixed-major-mode thing, or some other purpose. mixed-major-mode shouldn't be a problem. > Long lines? Easy to test, and the call to widen will do nothing anyway in that case. > Do we recall the exact design idea why tree-sitter visibility is limited > by the narrowing bounds? For the same reason: because the buffer is inaccessible outside the restriction, and tree-sitter wants to access the buffer text. > Because if we wanted to widen in all similar situations, we might as > well make it not obey the narrowing at all. It is impossible to not obey narrowing, not in Emacs. I told that and explained that many times already, including simple examples of what trouble this could cause to even the most innocent Lisp code. I hoped that by now this should no longer be brought forward.