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#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes Date: Fri, 31 Mar 2023 04:10:54 +0300 Message-ID: <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@yandex.ru> References: <87fs9yur7r.fsf@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> <728618716b8c5349d27e@heytings.org> <83bkke9uue.fsf@gnu.org> <83ilel861g.fsf@gnu.org> <290987e0-821e-a231-c1c4-b40bb9542ffe@yandex.ru> <83lejf7r2o.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="870"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Cc: wkirschbaum@gmail.com, gregory@heytings.org, casouri@gmail.com, 62333@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 31 03:12:14 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 1pi3JO-000AZ4-Ej for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 Mar 2023 03:12:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pi3JE-00072o-6W; Thu, 30 Mar 2023 21:12: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 1pi3JC-00072c-F2 for bug-gnu-emacs@gnu.org; Thu, 30 Mar 2023 21:12: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 1pi3JC-0000IH-6D for bug-gnu-emacs@gnu.org; Thu, 30 Mar 2023 21:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pi3JB-0002lf-Kb for bug-gnu-emacs@gnu.org; Thu, 30 Mar 2023 21:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 Mar 2023 01:12: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.168022506510576 (code B ref 62333); Fri, 31 Mar 2023 01:12:01 +0000 Original-Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 01:11:05 +0000 Original-Received: from localhost ([127.0.0.1]:59881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pi3IG-0002kV-WD for submit@debbugs.gnu.org; Thu, 30 Mar 2023 21:11:05 -0400 Original-Received: from mail-wm1-f52.google.com ([209.85.128.52]:44961) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pi3IE-0002k0-FF for 62333@debbugs.gnu.org; Thu, 30 Mar 2023 21:11:03 -0400 Original-Received: by mail-wm1-f52.google.com with SMTP id u11-20020a05600c19cb00b003edcc414997so12922715wmq.3 for <62333@debbugs.gnu.org>; Thu, 30 Mar 2023 18:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680225056; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=ZRGq1nSSOs7fseaz0nXB+F8SI7Kmf8e6OTnzxJwO7pU=; b=aJROPCQTd7Btn6hadlLbtnY4F7H8ISVw7xXkDhmiAnUI/DePIcs9REiB7ii1Z88TK5 UOJo9N3gdVVtEwICmrKpGwq+eiqA66N1kTmpkxLfg8WB9qjtaNzPKsJvzfYcW+vd9Qco xYkRl8xi5OiceWOJwUtY/x5cXiPqYyUtMS8NiRNLREZho0VwnzVw6mXcHS1N0SSFCeKB DF/372tb2K3sjLjsZZDmvvtK9xJ7wh+T0Gf7UVmiQhd+h2GGBXdB7w9WErRsDfE3tUy9 UBYPEZ7IYOroyFcn/mnoJIcZODDFZsKYT9PN1vVOHb/J1DRYiUKlih02y/cNf1qfn8Th xCQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680225056; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZRGq1nSSOs7fseaz0nXB+F8SI7Kmf8e6OTnzxJwO7pU=; b=X1bxz/NvrkD637dAwD6TdfeymAF+BAoRYuK1ttWGGRrm3bEbFcSKIyVVWv50jCiiyX HTQlUwfeDlty51x6uLRDiupQHUrkhyIKdXNO8KCk7r9JcxJD775zjr8lidDHeODGzLzk bQs/R6mceHoPsXCve3h57HClxELvWq9dvoA+tYMH9c5U2tt+5aot9HaIr3jQ+nWg4rb1 frbyO7nHabIaWE2vJmjdgVyqef0AcdMWWBGmJWPZFJ+/Klp4agiiJOJFRagqWeiuy7P1 twgOQ0Jjjxx4pP59ioT+G6F1CC3+EhByuiCIM70W4qOf5LAtB/GYO5f8R1YP75N8p00O 4LXQ== X-Gm-Message-State: AO0yUKWwqVzYrBjLn8tnUwRkGi2aD2l7LQVWKY8L6bqHuWsUH/wlFnJk wOixXmUze059TQcIWgUnO2I= X-Google-Smtp-Source: AK7set8Q+2et/XHI9+jDudyLrMHk1iCy4YPCi71qOJknhzLgcKbXLaHRrmPwHx8DS6m0Mv+r3VdtKA== X-Received: by 2002:a05:600c:d5:b0:3ed:2eb5:c2dd with SMTP id u21-20020a05600c00d500b003ed2eb5c2ddmr18698332wmm.39.1680225056578; Thu, 30 Mar 2023 18:10:56 -0700 (PDT) Original-Received: from [192.168.1.2] ([31.216.80.60]) by smtp.googlemail.com with ESMTPSA id q3-20020a05600c46c300b003ebf73acf9asm14844859wmo.3.2023.03.30.18.10.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Mar 2023 18:10:56 -0700 (PDT) Content-Language: en-US In-Reply-To: <83lejf7r2o.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:258954 Archived-At: On 29/03/2023 14:08, Eli Zaretskii wrote: >> Date: Wed, 29 Mar 2023 00:08:53 +0300 >> Cc: wkirschbaum@gmail.com, gregory@heytings.org, casouri@gmail.com, >> 62333@debbugs.gnu.org >> From: Dmitry Gutov >> >>>> Is that because we don't think the user level narrowing is done purely >>>> for visual effect? >>> >>> Indeed, it isn't always for visual effect. >> >> When isn't it? Is there a way to determine that from code? > > I'm not sure I understand the question, but if I do, then narrowing to > prevent search functions If we're talking about isearch, then that seems like a natural consequence of visual effect (hiding the remainder of the buffer): even if isearch highlighted those other hits, they would not be visible. > and commands from finding irrelevant hits is > one example that comes to mind. More or less the same, except we have the user option widen-automatically, which apparently (?) allows any command to "widen when they want to"? Used by popular demand in e.g. xref--goto-char. And IIUC 'find-tag' just always calls 'widen' irrespective of this variable's value. >>>> judging by regular user requests for make this or that command >>>> ignore user-level narrowing, it seems like "purely visual" should be the >>>> default interpretation. >>> >>> I think you base your judgment on feedback from users who are not used >>> to take advantage of narrowing in editing. I think most young people >>> aren't, since this feature is more-or-less unique to Emacs. >> >> Either narrowing should be used to change lexical/grammatical/etc >> context, or it should not. Do we have any documentation that says one or >> the other way? That should affect how Lisp code deals with narrowing -- >> which interactive functions should widen, and so on. > > I was talking about user commands that narrow, so I'm not sure I > understand how documentation could help. When the user types "C-x n n", > there's nothing Emacs can do except obey. There is really only one main user command that narrows, and that's narrow-to-region, bound to 'C-x n n'. But none of that describes how other Emacs features should react to it. Simple example: if the beginning of the narrowed region falls inside a (let's say multine) string, should the visible remainder of that string continue to be highlighted as a string? Or should the buffer contents after the string's closer now be highlighted as being inside a string?