From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#60983: 29.0.60; Tree-sitter user-level control Date: Sat, 4 Feb 2023 23:54:56 -0800 Message-ID: <1CC382C7-8663-4F12-9163-916EE1FFCFBB@gmail.com> References: <83tu0kkuqo.fsf@gnu.org> <7B62BDA1-C46B-4373-B3A7-2F9E34F3D803@gmail.com> <83tu03ur55.fsf@gnu.org> <83zg9sslat.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13437"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60983@debbugs.gnu.org, theo@thornhill.no To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 05 08:56: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 1pOZsk-0003IL-Jz for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Feb 2023 08:56:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOZsb-0008Hr-QQ; Sun, 05 Feb 2023 02:56:08 -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 1pOZsY-0008HT-0j for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 02:56:03 -0500 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 1pOZsX-0002BS-PM for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 02:56:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pOZsX-0000Il-LW for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 02:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Feb 2023 07:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60983 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: Bug Report Emacs , theo@thornhill.no Original-Received: via spool by submit@debbugs.gnu.org id=B.16755837161098 (code B ref -1); Sun, 05 Feb 2023 07:56:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Feb 2023 07:55:16 +0000 Original-Received: from localhost ([127.0.0.1]:44020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOZrn-0000Hb-Gt for submit@debbugs.gnu.org; Sun, 05 Feb 2023 02:55:16 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:54608) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOZrk-0000HR-9E for submit@debbugs.gnu.org; Sun, 05 Feb 2023 02:55:14 -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 1pOZrk-0008Ao-1r for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 02:55:12 -0500 Original-Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOZri-0001xj-G5; Sun, 05 Feb 2023 02:55:11 -0500 Original-Received: by mail-pl1-x632.google.com with SMTP id h15so1885973plk.12; Sat, 04 Feb 2023 23:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4wCv6z+OYu09K5Pfmwx8Z4tlSzMHrc2KNbHsOBlaJ1I=; b=XdcLnCdP/0e1gej8mbtLbm8rNdFXSquHC1rk4GuwnYoSNsIq6s4CEbc6OXGK2XXxea yloNHC8qI3OJfRS6XzlONuq8AIlRS4npLMaz879P1IjLKXycBaN0NHsEMCuSkyRaB/rm /4KZfBD52mf8dWhNf1eE7fWMXos0M93CzCXPrlX79iGEeByFg18iwFdD0K/VvfVEmXgb XiR1nCbezYOt99ctiiNBrTWYR9flYSRX10ns5wULAO6G+i/5PEEM6zooMynNJj8111pe RPMa9K2ThSmi9i4UMivSw4rt80Okxl25N+lY6FrV0kkNhfmEjjUYqbtEFGchrQc0OKKg Q0pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4wCv6z+OYu09K5Pfmwx8Z4tlSzMHrc2KNbHsOBlaJ1I=; b=jHzfDh/0ehGh9vngWVk+jZXYVND4tEU0zBAqtw3DEII9OkjQ0OYx/op5rZNHz9g30A WJMzHjXxPCcX6NSu0ngILVpVRDP19QJjOG9gh/d/U4C0GVVADia2Nmm1ceif38lGi0vY kCI7CcNKiykNXIII2Gu+dsWVawK87oBfQZamcXMNofp+mF0h9V1kjZboX/Jr/91pJU3l HSwxTEHvc7jiPHnfUqMMUpgchLWl63I0EhiscG7Wl4ataS6ALdAkFJuj6CXDWnSELg1d IPEuz7Z1QGz4yqPv8+deo/J4xLolFWzlBXgGzPAtl8vbmslgagtHKP/E84qNVmljicNu rcQQ== X-Gm-Message-State: AO0yUKXPU11i0P1nkO6QeCvKSRTA6qLqUm7xvszl+CZwVHgMAdW3K9Dp judV5cHut5ec7xbjhlnoKuNKndzzxZc= X-Google-Smtp-Source: AK7set+ay/MuviFP7H4vcWIks0F8BE80LJg5ruquHlS/7Pkdt6HWyrqBRSuI7+DcY5ul3G+knijyQQ== X-Received: by 2002:a17:902:cec8:b0:196:88e0:ea10 with SMTP id d8-20020a170902cec800b0019688e0ea10mr18012074plg.60.1675583708284; Sat, 04 Feb 2023 23:55:08 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id a2-20020a170902ee8200b00186f0f59c85sm4458586pld.235.2023.02.04.23.55.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Feb 2023 23:55:07 -0800 (PST) In-Reply-To: <83zg9sslat.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.300.101.1.3) Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=casouri@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:254825 Archived-At: > On Feb 4, 2023, at 10:01 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Sat, 4 Feb 2023 15:38:17 -0800 >> Cc: Bug Report Emacs , >> theo@thornhill.no >>=20 >>> treesit-font-lock-recompute-features is a non-interactive function, = so >>> mentioning it in the user manual is generally inappropriate. Users >>> are unlikely to add features that aren't already defined in the = mode's >>> font-lock setup. >>>=20 >>> This function and its use in these situations are described in the >>> ELisp manual, where I think it belongs. >>>=20 >>> As for the fact that changing treesit-font-lock-feature-list = directly >>> doesn't have any effect, that is already in the doc string. I'm not >>> opposed to mentioning that in the manual as well, but I see no = problem >>> with what we have. >>=20 >> I see. Sounds good to me. I meant enabling/disabling features when I = say =E2=80=9Cadding/removing=E2=80=9D features. Does that make anything = different? >=20 > Yes, that's how I understood what you were saying: changing the list > of features enabled/disabled by specific levels. This is not a > user-level thing, so describing it in the ELisp manual is good enough, > I think. (If it turns out users want to do this kind of thing too > often, it probably means our design of the user-facing features is > sub-optimal and should be improved.) I see, my description and the documentation is still not clear enough, = I=E2=80=99m afraid. treesit-font-lock-recompute-feature does not = add/remove features that belongs to a level. The design is that, the = user uses decoration level to set the rough level, which enables a set = of features, then use treesit-font-lock-recompute-feature to do more = fine-grained control by additionally enabling/disabling features.=20 For example in c-ts-mode, if I set the decoration level to 2, I=E2=80=99d = have these features: comment, definition, keyword, preprocessor, string, = type. If I also want the assignment features, which is in level 3, but = don=E2=80=99t want other features in level 3, I would use = treesit-font-lock-recompute-feature to enable that feature. Similarly, I = can use treesit-font-lock-recompute-feature to disable the preprocessor = which is at level 2, without affecting other features status. Yuan