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.devel Subject: Re: Define treesit-font-lock-level as buffer local Date: Sat, 9 Nov 2024 00:36:31 -0800 Message-ID: <39CF8919-E0A5-44D7-AA7E-ECD7465620A1@gmail.com> References: <4929184.OV4Wx5bFTl@3-191.divsi.unimi.it> <861pznqp9m.fsf@gnu.org> <2730223.lGaqSPkdTl@3-191.divsi.unimi.it> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) 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="30841"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org To: Vincenzo Pupillo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 09 09:37:39 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 1t9gyR-0007xJ-K7 for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Nov 2024 09:37:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9gxc-0003dw-LN; Sat, 09 Nov 2024 03:36:48 -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 1t9gxb-0003de-3e for emacs-devel@gnu.org; Sat, 09 Nov 2024 03:36:47 -0500 Original-Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t9gxZ-00055q-Ig; Sat, 09 Nov 2024 03:36:46 -0500 Original-Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-720be27db74so2313904b3a.1; Sat, 09 Nov 2024 00:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731141403; x=1731746203; darn=gnu.org; 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=SDmeqJ/MUtvPdLlAACw4xYHXTmWZ4xq8NpOnZWkdEUM=; b=JkIAHmgCeUro3Y0ayGZrHyQasdDS0JzUdTkQr+5Nz3Mu+BySK8OAl8PijMparSgE1k OqLbBvp6m0Vhn7p8i6+AnRqNznaUUnXKD4hnWIwNdhvTmGd4qBt5GDwNzf5yjJrxZc0F l0GqOkdwLPFuEi9n06tiItjnMINLv51LazKmAX+eA5Scj1yLGTV1h6rpq02zVlVi6DNy O75odpKLYQB7C+wABWRpMmYLJb5j7Hy6bfhIchg2gwkibOpTo6OoAvne19es1Qo4ScIh WFDehv9HI4n2m3c2E8QUxbDk/eLaDMMMXcVMgSmnhBXANUFuy8MGXNNu6u5sqY/xEYAI LQ0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731141403; x=1731746203; 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=SDmeqJ/MUtvPdLlAACw4xYHXTmWZ4xq8NpOnZWkdEUM=; b=SCt5tCGzLOSeTH9Nw7FRrmnRg+nniQOD3Fr8uY6yDJivCNjmyhglIco951Nx6Qu2SR PIoCAyqY+nobi1FLkrTVvTN7001QLq8T3sZhGvajcTwl925vLExxBb0KYrHoZMIYvnjF m4GQuyLD8Mpa05L/f4/tvqp+VHdsnrLJ2/4b9hfn48YO2aQftKTLHl6AP7GfOX3UixYA Ejfoc9U835CkON7q0L0f21dYE2pm5Pp99OPM3jFSDXKg+UawG1FexLDnh2MNOa4nbzwk h2FpUf6Jf4tm85abgfWDtZQ0NgPQ3jnBnDUh7sixhZk6Khb2BT4kwk5lKJFh0opWS8gn TITA== X-Forwarded-Encrypted: i=1; AJvYcCW4pH8EYipb5xCpleQl3QXQ7HwV8Wko8688VQc//jK2v/FKFoQXzEbUyFuu1uhYYTg/AXssteo1uF/lNw==@gnu.org X-Gm-Message-State: AOJu0YycnnZRf5lTeI8F1p6xM102NBsvxACDUEI9tMFOaki2XGTIxdv0 o8hcEtE5rQ0HYmMYhI75mXSG2FE9BUVmKKy1/F/GywLrWyvTRLuE X-Google-Smtp-Source: AGHT+IGwyMWkCrVrxw5wv4/hgAcdj8dEOBAw3GMrm2El1yXX4JlhfBkW/Qn9XgX8O0bTYpYJeIQQDw== X-Received: by 2002:a05:6a00:2185:b0:71e:74f6:f83a with SMTP id d2e1a72fcca58-724121c7bd1mr12200056b3a.3.1731141403205; Sat, 09 Nov 2024 00:36:43 -0800 (PST) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:1524:1329:2a87:2c60]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72407a18f46sm5119114b3a.154.2024.11.09.00.36.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Nov 2024 00:36:42 -0800 (PST) In-Reply-To: <2730223.lGaqSPkdTl@3-191.divsi.unimi.it> X-Mailer: Apple Mail (2.3776.700.51) Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=casouri@gmail.com; helo=mail-pf1-x432.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: 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:325322 Archived-At: > On Nov 7, 2024, at 3:08=E2=80=AFAM, Vincenzo Pupillo = wrote: >=20 > In data gioved=C3=AC 7 novembre 2024 12:03:49 Ora standard = dell=E2=80=99Europa centrale, Eli Zaretskii ha scritto: >>> From: Vincenzo Pupillo >>> Date: Thu, 07 Nov 2024 11:30:03 +0100 >>>=20 >>> Ciao, >>> I use tree-sitter for different languages, for some of them I prefer = font lock level 3, for others I prefer level 4.=20 >>> treesit-font-lock-level, however, is not defined as buffer local and = so there is no elegant way to have=20 >>> different levels for different languages.=20 >>> Would it be possible to define treesit-font-lock-level as a buffer = local? >>=20 >> Is it a problem for you to do that in your init file? >=20 > No, it's not a problem. >=20 >> 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. =20 > Yes, this would be a better solution. >=20 >> Yuan, WDYT? >>=20 Perhaps even per-language, for multi-language modes. I think it=E2=80=99s = a valid use case. IMO, specify the level by language is better than = mode. For single language modes, using the language is equivalent to = using the mode; for multi-language modes, using the language allows more = flexibility.=20 Yuan=