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 16:26:31 +0300 Message-ID: <54841ad6-2fc3-a300-9fcc-9082f6aee75c@yandex.ru> References: <87fs9yur7r.fsf@gmail.com> <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> <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@yandex.ru> <83wn2x30js.fsf@gnu.org> <83jzyx2wiy.fsf@gnu.org> <7dfe5826-36c1-6084-ab9b-066651bde17f@yandex.ru> <834jq12htt.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="7453"; 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 15:27:15 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 1piEmg-0001kk-Vq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 Mar 2023 15:27:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piEmX-0007By-2v; Fri, 31 Mar 2023 09:27:05 -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 1piEmU-00077p-6B for bug-gnu-emacs@gnu.org; Fri, 31 Mar 2023 09:27: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 1piEmT-0007O7-UA for bug-gnu-emacs@gnu.org; Fri, 31 Mar 2023 09:27:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1piEmT-000186-QS for bug-gnu-emacs@gnu.org; Fri, 31 Mar 2023 09:27: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 13:27: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.16802692024313 (code B ref 62333); Fri, 31 Mar 2023 13:27:01 +0000 Original-Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 13:26:42 +0000 Original-Received: from localhost ([127.0.0.1]:60766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piEm9-00017V-Em for submit@debbugs.gnu.org; Fri, 31 Mar 2023 09:26:41 -0400 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:37810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piEm7-00017E-Ak for 62333@debbugs.gnu.org; Fri, 31 Mar 2023 09:26:39 -0400 Original-Received: by mail-wr1-f43.google.com with SMTP id y14so22400046wrq.4 for <62333@debbugs.gnu.org>; Fri, 31 Mar 2023 06:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680269193; 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=F3Ty+ZNBi7D6Vf8zzINGK044apufCOT65vr+1IqIzsY=; b=gmGAHdAhgNjwAi2/yVvgc/ZASppPAQhjNV9JRngFSNzmjxud4konssbR5FW45ZQCQp zovXct5SEgLonF31XvJ3KPlZUMxB3hQtdjivAabAX2+s7vXg7rd6KeTMO8p60adm2jAd 90fvkfwyDrDxsdxeaSBJjzRYi/2TZ2b2n77hfj/q/7eSX47XKMA8mVFG0pLbDhTxtT1W kYBl8oP+3UBfO0UlvAC5u9XKncCig6zHozBFq68a46UKDd5x8Ypfsv+KXBb8tQcf4Cfm p6bIna8LEvXRCrJkpk0R1we2n71gYu+KUiBdc4ISTrqEfL51gVjVQX74/HFEKjNyQzTk Q9dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680269193; 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=F3Ty+ZNBi7D6Vf8zzINGK044apufCOT65vr+1IqIzsY=; b=gzRwSfkhg52vDCgHJKL/jQSdsjs8tt9wBVzU9uavsPWLr4hbv/lwb1+D0KWH9fIDHH RnWSnzHjXkQZGhVZhte6qgjYYuarVkSkErc1b4lBhl72T13NvswfGwQOX96KEyJGhg2w 2RhSN3e3viWFyAHXvXTFCXrMe9bL/YV+DAUQtU3NC4wMl1ZGSmWr/oCSpZghdX2Z+j9E oW7D0OOFZREEm4qoWGV7oFi92gzi922gpYWvSQCxQSGla+CCGoDEqRK90pArwrMASB6a nhFTR4kWqBqXrMVLFj3pDU8t3DAyI/3m4P3cH/JOArWkbyA4CIuqQFV/LBhVJxhZXLQ4 PMXQ== X-Gm-Message-State: AAQBX9eAckkWaA5vdaADf4cuYLq2qcnBPlgixt4s5gxhLGXyE7QVa0Pm 33KYgc6lBEct29hZvF9hPz3WSQPU4JFTzg== X-Google-Smtp-Source: AKy350bwXKnMl/VfTT0iK2feIJvaBxK9eBhC86NxtEplgtf7RJdFo/NYswLA68EBkLLt2QDB6t6s6Q== X-Received: by 2002:adf:f885:0:b0:2cf:e77e:2eef with SMTP id u5-20020adff885000000b002cfe77e2eefmr22398098wrp.8.1680269193682; Fri, 31 Mar 2023 06:26:33 -0700 (PDT) Original-Received: from [192.168.1.2] ([31.216.80.60]) by smtp.googlemail.com with ESMTPSA id o18-20020adfe812000000b002daf0b52598sm2237931wrm.18.2023.03.31.06.26.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Mar 2023 06:26:33 -0700 (PDT) Content-Language: en-US In-Reply-To: <834jq12htt.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:258993 Archived-At: On 31/03/2023 16:03, Eli Zaretskii wrote: >> Date: Fri, 31 Mar 2023 15:38:33 +0300 >> Cc: wkirschbaum@gmail.com, gregory@heytings.org, casouri@gmail.com, >> 62333@debbugs.gnu.org >> From: Dmitry Gutov >> >> On 31/03/2023 10:46, Eli Zaretskii wrote: >>>> Cc:wkirschbaum@gmail.com,gregory@heytings.org,casouri@gmail.com, >>>> 62333@debbugs.gnu.org >>>> Date: Fri, 31 Mar 2023 09:19:35 +0300 >>>> From: Eli Zaretskii >>>> >>>>> 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? >>>> No. >>>> >>>>> Or should the buffer contents after the string's closer now be >>>>> highlighted as being inside a string? >>>> Yes. >>> To clarify: these my answers are in the context of the current >>> handling of narrowing, not in the context of restricting the parser >>> (which you seem to reject as a useful idea anyway). >> >> Interesting. >> >> You do realize that it doesn't work this way currently, right? > > Yes. So... do you think we should flip font-lock-dont-widen's default to t? Then the behavior can be like you answered, and we could alter other features (e.g. indentation) too. Note that that variable goes back to 2002, though. And regarding indentation: with that kind of the change, narrowing region to a fragment of a function definition (cutting out its beginning) will usually make indentation shallower, when code outside of narrowing is considered absent.