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: Fri, 03 Feb 2023 09:47:34 +0200 Message-ID: <83tu03ur55.fsf@gnu.org> References: <83tu0kkuqo.fsf@gnu.org> <7B62BDA1-C46B-4373-B3A7-2F9E34F3D803@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="30917"; 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 Fri Feb 03 08:48:26 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 1pNqo5-0007oc-Ue for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Feb 2023 08:48:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNqnk-0003ra-KJ; Fri, 03 Feb 2023 02:48:04 -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 1pNqni-0003rP-G0 for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 02:48:02 -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 1pNqni-0005YH-84 for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 02:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNqnh-0006Tq-RK for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 02:48: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: Fri, 03 Feb 2023 07:48: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.167541045924759 (code B ref -1); Fri, 03 Feb 2023 07:48:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Feb 2023 07:47:39 +0000 Original-Received: from localhost ([127.0.0.1]:36423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNqnL-0006RE-AN for submit@debbugs.gnu.org; Fri, 03 Feb 2023 02:47:39 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:37336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNqnJ-0006Qr-3V for submit@debbugs.gnu.org; Fri, 03 Feb 2023 02:47:37 -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 1pNqnG-0003q2-8a for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 02:47:34 -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 1pNqnD-0005T8-Uv; Fri, 03 Feb 2023 02:47:33 -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=9IffI0usOFfFW5f5a4MP44eE4/R7KF72+M2gDWB6+Vo=; b=LXjhUmtet9pMA38wyF/2 sdVBE6bYxF1KP6Bl87fA6bJ2W/Gklt27HaB+3bUGoy45w9h0gm3gcbPb4HGU+iKwmiaPPytEQJ8GK L/naW5ZwCp/gEiB+awgx7B1SXgdOHQWWABCRoNuJFl3qxB+t13ggiRGuqn1npmsI3NBS8zLI+9wCf oVn1pFXQH3zlIgoMVyuRUnqs1Rmfqf71nx7m7+s3/Yj9TBKnrT9HujxqwtwPxviZx8/DfP92oWnwV M4Bjm/7HVt48LZpDt4MiVmwd8DksPSChkDQrnc9OV0cONiusALjJTY4fUyAeAtVLIriPH4KPzgkFE pgLfChGw+CPuSw==; 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 1pNqnC-0002LB-WE; Fri, 03 Feb 2023 02:47:31 -0500 In-Reply-To: <7B62BDA1-C46B-4373-B3A7-2F9E34F3D803@gmail.com> (message from Yuan Fu on Thu, 2 Feb 2023 19:07:07 -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:254716 Archived-At: > From: Yuan Fu > Date: Thu, 2 Feb 2023 19:07:07 -0800 > Cc: Bug Report Emacs , > Theodor Thornhill > > I just read the new manual sections, thanks for the work! Do we want to mention treesit-font-lock-recompute-features in the user manual? That’s the only way for someone to add/remove specific features (as opposed to changing the decoration level). (We might also want to mention that changing treesit-font-lock-features directly doesn’t have any effect, similar to treesit-font-lock-level.) 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. This function and its use in these situations are described in the ELisp manual, where I think it belongs. 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. > treesit-font-lock-recompute-features is intended to be used in major mode hooks, like > > (add-hook 'c-ts-mode-hook #'c-ts-setup) > > (defun c-ts-mode-setup () > (treesit-font-lock-recompute-features > '(emacs-devel) > '(property bracket delimiter operator variable function))) This belongs to the ELisp manual, IMO.