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#60983: 29.0.60; Tree-sitter user-level control Date: Sun, 05 Feb 2023 11:23:31 +0200 Message-ID: <83ilggsbxo.fsf@gnu.org> References: <83tu0kkuqo.fsf@gnu.org> <7B62BDA1-C46B-4373-B3A7-2F9E34F3D803@gmail.com> <83tu03ur55.fsf@gnu.org> <83zg9sslat.fsf@gnu.org> <1CC382C7-8663-4F12-9163-916EE1FFCFBB@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16640"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60983@debbugs.gnu.org, theo@thornhill.no To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 05 10:24:37 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 1pObGF-000476-Cf for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Feb 2023 10:24:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pObFz-0007Tc-CG; Sun, 05 Feb 2023 04:24:19 -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 1pObFt-0007TH-Q2 for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 04:24:16 -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 1pObFi-0006Mu-7x for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 04:24:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pObFh-0002c4-RD for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 04:24:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Feb 2023 09:24: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-gnu-emacs@gnu.org, theo@thornhill.no Original-Received: via spool by submit@debbugs.gnu.org id=B.16755890119998 (code B ref -1); Sun, 05 Feb 2023 09:24:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Feb 2023 09:23:31 +0000 Original-Received: from localhost ([127.0.0.1]:44074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pObFD-0002bB-9H for submit@debbugs.gnu.org; Sun, 05 Feb 2023 04:23:31 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:51610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pObF8-0002b0-PA for submit@debbugs.gnu.org; Sun, 05 Feb 2023 04:23:29 -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 1pObF4-0007QE-P4 for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 04:23:25 -0500 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 1pObF4-0006Jq-Bw; Sun, 05 Feb 2023 04:23:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=4LeKSI6TNqEcbgoKkG+/i9QxHN+dZCON6VZMNXlQ5nU=; b=oirJziLRXTPsrfjGBYUS Ui+tP5y5XjRqH8sPnQ8zGb8+GHKoBuqtEWkpO6wINZMOBpAT69Iteo3fZ7TYNKLu2powCe6Wa6qY+ 2MuvoBNgDXibhIGqbaM/J1A2pa8Wxjv0fskGxRcrvW/tv130rB1o4VI7Q7Z2dxXntWMNSvr3XNqb+ d1MoxNvWZ9bcDTn4vn3ENZ5HkTUm5P1ocIHsnR/9lb3zQS42WLWnVp1jWV5NZbTlB5xxTY0jrp+FV b7Rf4Dm5shKQn1KJtwoj6Ym8C3/31aOU6JN8Jm5wg4wDRUJFIHRH3oCXuHXzfFaFpfv0QSzzILP9X 92YiLrC+tP5DDA==; 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 1pObF3-0006K6-5r; Sun, 05 Feb 2023 04:23:21 -0500 In-Reply-To: <1CC382C7-8663-4F12-9163-916EE1FFCFBB@gmail.com> (message from Yuan Fu on Sat, 4 Feb 2023 23:54:56 -0800) 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:254830 Archived-At: > From: Yuan Fu > Date: Sat, 4 Feb 2023 23:54:56 -0800 > Cc: Bug Report Emacs , > theo@thornhill.no > > > 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’m 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. > > For example in c-ts-mode, if I set the decoration level to 2, I’d have these features: comment, definition, keyword, preprocessor, string, type. If I also want the assignment features, which is in level 3, but don’t 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. That's exactly what I understood, and that was what I responded to. I don't think it's a user-level feature to tweak the list of features that are enabled/disables by a certain decoration level. It is on the level of Lisp programming, and therefore should be described in the ELisp manual.