From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter central configuration variable Date: Fri, 29 Nov 2024 08:12:43 +0100 Message-ID: References: <4929184.OV4Wx5bFTl@3-191.divsi.unimi.it> <861pznqp9m.fsf@gnu.org> <2730223.lGaqSPkdTl@3-191.divsi.unimi.it> <39CF8919-E0A5-44D7-AA7E-ECD7465620A1@gmail.com> <86a5e8okhx.fsf@gnu.org> <868qtam99v.fsf@gnu.org> <137AE507-F467-4FB2-83DB-EC621F868C60@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12184"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Vincenzo Pupillo , Emacs Devel , Stefan Kangas , Stefan Monnier , Dmitry Gutov To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 29 08:13:50 2024 Return-path: Envelope-to: ged-emacs-devel@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 1tGvCI-00030V-0i for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Nov 2024 08:13:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGvBV-0008Dk-Hn; Fri, 29 Nov 2024 02:13:01 -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 1tGvBL-000869-RJ for emacs-devel@gnu.org; Fri, 29 Nov 2024 02:12:54 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGvBI-0007MG-H2; Fri, 29 Nov 2024 02:12:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1732864366; bh=1ImWvSe2vTdpeGb/OAbekPm0z9QaeHyEwrK4yvvIeJE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=or3pFbnNDgAsRseU5zCLBFwqEDmFve8bO6v9vnb/sruDt/jApw89VwZYpnAZK3XpD GN/a0VDjpvXZ+ab2cKh0pUT+a4HVp6Xo/HLseVJEsfrDxjbvr+HYN2IeCh03M3bJf7 TVQG5Mq7Ca4EOoG54H+ep5kTgOzD4YMILO/GoQLPHT6TdiNdeYhdvuax/LTip60c2P PEkXJEdN6rGdb3syGobnbdo61vP46s9Su3k0eilV56xsiYpA/UGqn4AoKCpS88+waV 2nj1c69enFtA9We2+XyLs2w3egnVm1jU6I5lSoOWFQoR1wcVaRVxc3+whhZcfT20jt iJpSIvbODDlyg== In-Reply-To: <137AE507-F467-4FB2-83DB-EC621F868C60@gmail.com> (Yuan Fu's message of "Thu, 28 Nov 2024 21:49:33 -0800") X-Hashcash: 1:20:241129:dmitry@gutov.dev::c0rxFV7TLWtKCaBA:P/m X-Hashcash: 1:20:241129:casouri@gmail.com::oc9yag+NjkxMgkF8:3MFa X-Hashcash: 1:20:241129:eliz@gnu.org::rsNO8XnAo8X3hJfg:1VGt X-Hashcash: 1:20:241129:v.pupillo@gmail.com::j84+kwWhQ8fwNa+A:3aCO X-Hashcash: 1:20:241129:emacs-devel@gnu.org::vWuH4a9SkyzhZrdI:ZuV X-Hashcash: 1:20:241129:stefankangas@gmail.com::bCsvZacjO3yQ06Cd:3RVg X-Hashcash: 1:20:241129:monnier@iro.umontreal.ca::7IZDys2VG6NSgrbq:6CGd Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325843 Archived-At: Hi, Yuan Fu writes: > Actually, I want to expand this to something that allows users to > configure tree-sitter modes and toggle on/off tree-sitter features. > [...] > > What do you guys think about something like this: > > (setq treesit-global-configuration > '((c-ts-mode > ;; Set treesit-font-lock-level to 4 > (font-lock-level . 4) [...] > ))) > FWIW, I think tree-sitter should be treated as an implementation detail, not a user-facing concept. Tree-sitter empowers major mode developers, but users shouldn't have to know or care about tree-sitter to benefit from it. So a TS-specific configuration user option is not the best approach IMO. (For the same reason, I'm not a big fan of the "powered by tree-sitter" that we have today in the docstring of various modes.) Instead, when it comes to settings that apply across major modes, I think we should focus on knobs that make sense whether or not a mode is TS-based, and have the TS-based modes respect such universal settings. Just my 2c, Eshel