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: Tue, 28 Mar 2023 14:38:21 +0300 Message-ID: <83h6u585si.fsf@gnu.org> References: <87fs9yur7r.fsf@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> <831qlcdisi.fsf@gnu.org> <398721ad-79b0-3f6d-97b3-4902d9bfbe39@yandex.ru> <83wn34c2qa.fsf@gnu.org> <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@yandex.ru> <83r0tcbz8g.fsf@gnu.org> <1967361679760225@umbzx4hqxrw5qxo7.sas.yp-c.yandex.net> <83mt40bxzd.fsf@gnu.org> <83jzz4bugh.fsf@gnu.org> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@yandex.ru> <831qlcaysh.fsf@gnu.org> <29679184-7366-0167-9e94-def97048f663@yandex.ru> <83v8inal29.fsf@gnu.org> <9886ffa5-ead2-50d5-a325-f6704b736ada@yandex.ru> <83fs9q9vak.fsf@gnu.org> <10aa98b6-908b-c467-7c77-767906692088@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22784"; 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 Tue Mar 28 13:39:27 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 1ph7fj-0005jM-AU for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Mar 2023 13:39:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ph7fL-000781-VQ; Tue, 28 Mar 2023 07:39:03 -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 1ph7fK-00077o-In for bug-gnu-emacs@gnu.org; Tue, 28 Mar 2023 07:39: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 1ph7fK-0004Xj-AK for bug-gnu-emacs@gnu.org; Tue, 28 Mar 2023 07:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ph7fJ-0006CQ-KY for bug-gnu-emacs@gnu.org; Tue, 28 Mar 2023 07:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Mar 2023 11:39:01 +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.168000350523783 (code B ref 62333); Tue, 28 Mar 2023 11:39:01 +0000 Original-Received: (at 62333) by debbugs.gnu.org; 28 Mar 2023 11:38:25 +0000 Original-Received: from localhost ([127.0.0.1]:49076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ph7ei-0006BW-QI for submit@debbugs.gnu.org; Tue, 28 Mar 2023 07:38:25 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ph7eg-0006BJ-BT for 62333@debbugs.gnu.org; Tue, 28 Mar 2023 07:38:23 -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 1ph7ea-0004SL-I0; Tue, 28 Mar 2023 07:38:16 -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=JfxXogxzz8UgoCyme2enn495/9YLR+RMK38MSrd43vA=; b=PkZBla1g3w6Z F63SKosSEBgaRYgwZNAfxdujtm/xMKAhtjJLXABZMW7yHAilfya147bvP7UVLp3b+UoXw0kC0UP/E kVXjuo4rpStjtkEgekycbq4WzEQvdsxI1D5iZE9vz223GTTFf+dL0ZvAyRWuJHTPnSbwvQZAFPCQN 8FMkS6Dq5fKey8ioR26grJr5SLOcYTVOBc+5cWI2hpCNKFQ/AvysZmqvllD0jSEMk6lhKR83NCJ4l o8OcQq9df69iPDr3h/Rstwkrr+5z7/MgFq0tUaB1Y2JJuWfLCrM22g7Kz4rAT0cEvXWHtmG5yU3mI QKzhY2wxfaCdDThFIzYU9Q==; 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 1ph7ea-0006wI-1c; Tue, 28 Mar 2023 07:38:16 -0400 In-Reply-To: <10aa98b6-908b-c467-7c77-767906692088@yandex.ru> (message from Dmitry Gutov on Tue, 28 Mar 2023 02:33:38 +0300) 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:258797 Archived-At: > Date: Tue, 28 Mar 2023 02:33:38 +0300 > Cc: wkirschbaum@gmail.com, casouri@gmail.com, 62333@debbugs.gnu.org > From: Dmitry Gutov > > > With parser-based features, we have an opportunity to do this in a > > cleaner manner. > > parser-based features don't need this at all, if considered in > isolation. But if we try to combine them with existing mode, or existing > packages, they need to play by the common rules. Which they currently do. Sorry, I don't see the relevance of that to what I wrote above. > >> If we take indent-for-tab-command, for example, it doesn't have such a > >> variable, and doesn't really need to: the top-level command calls > >> 'widen', and then indent-line-function (set by major mode and altered by > >> e.g. mmm-mode) is free to impose its specific bounds. > > > > I thought about a lower-level, infrastructure-level, mechanism that > > could be used to restrict a parser to a certain region of the buffer. > > Then this could be used by every feature based on parsers, instead of > > us having to invent a separate solution for each one. > > Like narrowing, but just for parsers? But parsers obey narrowing > already. Sounds a bit like conceptual duplication. How does this solve > blink-matching-paren issue anyway? We could widen without fearing that a parser will "invade" regions of buffer text that we don't want it to wander into. > >> The "grand unified theory of mixed major modes" has been attempted a few > >> times in the past, and never reached anything practical. > > > > But here we have a unique opportunity to maybe find a solution, at > > least for stuff based on tree-sitter and similar libraries. That > > maybe not "grand", but certainly "respectable". > > tree-sitter has its own support for mixed languages. So your argument about mmm framework was a red herring, cause that problem doesn't exist wrt tree-sitter parsers? > >>>> Except it's already limited by narrowing. > >>> > >>> Which is a fragile, semi-broken means, as we all know. > >> > >> What is a broken mess, is user-level narrowing. > > > > Which is why restricting parsers should not be a user-level feature. > > We're talking elisp-level, though. The problem with interactive > narrowing, is its impossible to tell apart from one effected by Lisp. > And they usually have different goals. Yes. So if this new feature will not be exposed to users, those dangers will be avoided. > >> What I've seen here so far is you suggesting we go ahead and break the > >> existing convention and then let "them" (third-party authors including > >> myself) come up with a new working one. > > > > You are mixing two semi-separate issues: how to fix the immediate > > problem with blink-matching-paren (if we consider it a serious > > problem), and how to try solving similar issues as a whole. > > Not mixing anything. We have one proposal for improving > blink-matching-paren integration anyway. It should be compatible with > whatever we choose regarding narrowing and mixed modes. > > > The > > latter is a long-term goal, and we can discuss it freely and calmly; > > whereby ideas can be brought up even if they might not be the most > > clever ones or the ones with which you personally agree. > > I'm not looking for "clever". > > >> My stance here is we shouldn't break it before we create a new one. > > > > No one broke anything. We are just discussing ideas. Please don't > > exaggerate. > > I never said anybody has broken anything already. You did say that my ideas break something, see above. Ideas cannot break any code, so this argument shouldn't be brought up if you want a calm and rational discussion.