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.devel Subject: Re: Define treesit-font-lock-level as buffer local Date: Thu, 07 Nov 2024 13:03:49 +0200 Message-ID: <861pznqp9m.fsf@gnu.org> References: <4929184.OV4Wx5bFTl@3-191.divsi.unimi.it> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38522"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Vincenzo Pupillo , Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 07 12:04:42 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 1t90Je-0009t4-5L for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Nov 2024 12:04:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t90Iu-0002i6-3f; Thu, 07 Nov 2024 06:03:56 -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 1t90Is-0002h3-Ft for emacs-devel@gnu.org; Thu, 07 Nov 2024 06:03:54 -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 1t90Is-0001IH-5b; Thu, 07 Nov 2024 06:03:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3xJTHTQoBf0KMavumJX6xLVGYdhUz+eElHFWD3NJ/Yc=; b=M/qGy4RjPxy0 ynWbC7EaJGfUonVETSL9l3v74vVsvuhv32xo1ZpkmfYSzF5OKarQ/8SbDMB/LB+jwugthRW+xK+d4 v6zoepzX04R5ga9VeXTTFNhRo1C7y0KM5tKwwXPWTh/FAvt7NqqptFXk7Nt9d0HNC9GYmWJ+dxCXJ YUGldVwbzWXs7OFefAf43ELcoOmID0K2MVhHWHKyqXSyDWhFaql5DZ5TMhxSjS+EnxjLNLpRTi4Su YJ+N/DesI2OtxFvPMJoAcN+ccza3OHxeHC1MpjnmIh2jeVAM86sAPL9jvXem4+Cq23nl/hhr8i/HN vXz4f6F3AX9rv6EbcdJYZQ==; In-Reply-To: <4929184.OV4Wx5bFTl@3-191.divsi.unimi.it> (message from Vincenzo Pupillo on Thu, 07 Nov 2024 11:30:03 +0100) 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:325219 Archived-At: > From: Vincenzo Pupillo > Date: Thu, 07 Nov 2024 11:30:03 +0100 > > Ciao, > I use tree-sitter for different languages, for some of them I prefer font lock level 3, for others I prefer level 4. > treesit-font-lock-level, however, is not defined as buffer local and so there is no elegant way to have > different levels for different languages. > Would it be possible to define treesit-font-lock-level as a buffer local? Is it a problem for you to do that in your init file? Also, we could support a value of that variable which is a list, like we do with font-lock-maximum-decoration. This will be more useful than making the variable buffer-local, since presumably your preferences are per-mode, not per-buffer. Yuan, WDYT?