From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: More font-lock faces for tree-sitter Date: Fri, 28 Oct 2022 08:10:31 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36494"; mail-complaints-to="usenet@ciao.gmane.io" To: Randy Taylor , "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 28 17:11:34 2022 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 1ooR1C-0009FK-9S for ged-emacs-devel@m.gmane-mx.org; Fri, 28 Oct 2022 17:11:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooR0G-0004ZE-2o; Fri, 28 Oct 2022 11:10:36 -0400 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 1ooR0F-0004YW-1J for emacs-devel@gnu.org; Fri, 28 Oct 2022 11:10:35 -0400 Original-Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooR0D-0000VB-GG for emacs-devel@gnu.org; Fri, 28 Oct 2022 11:10:34 -0400 Original-Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-13c569e5ff5so6208608fac.6 for ; Fri, 28 Oct 2022 08:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date:message-id:reply-to; bh=5j3tP1Rj5aaqATDcatsW6hbwA7tmauygVoWaXkwL7Js=; b=IzBLzyVzDLl8JjTeae8xwiTjTjOR2yWMng6vLF04uY9sHazTCIiCjBhbKRvLbydaHN Iemxmpg/QyJDEjk6Wbbsf0aMQRj4StPD6DJ30egcgsD2s6BtA8YGOVt+6vd6ngrYhHur Kqt+c81ck8daUh+mhY+PRlIw0Vzkx4b2BDIFES1dmreMMozqgTj7ukc14uYQC2Tt6g2C a3YW4Ayp2S93yrgzpIJJOvVbl/83t0AJMdZi+Jyai/vsz6Uudi9CcQMM4GEJ/LMkbQA0 7hSaEigfwmkpyAHTQIvOAXLO/CYQFzO2FJ2miqb6vePYCauMe+dVWObBwIesT397CqWq uu8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5j3tP1Rj5aaqATDcatsW6hbwA7tmauygVoWaXkwL7Js=; b=WKeQEwOkxuJ+CF9hYxENakQVAh7QyqiXWxU19DMxSCeB2Dgv/DvkajsDHP98Rp7uLc go1P7PSZVDMG/EeIhYPqTtClF2z4aF70T6egtJymWO6p3JhYtP6W5EYpFxE0GsSHeATu UHgMZ5pc/FSsMQR9zKSNeycLBNp5E+y5F7gid/b7iGLI6HgFTyK7ULZhaEdjNz8SEsEn LuEPSa7YRZQ+0XWGszRYFTyfAxR8msz4VRlZB2nXjFcFhzBPWszb2K4zctoqolX1rAMs PDKE4U1ImTx3aTusU0tGv8ou14AZydwBnaKrUczlvY3SYH/0hn5Dnb7s38gyyGDLgjz9 Ge2g== X-Gm-Message-State: ACrzQf0nVPa33tOkXuYCofiaalf3Qn6I3ryyNt0WKFDcS/afmQ5TPPTU XopX8gxUpyUjzCQRoJxOZRQUxORNkPAO5VGcHp75KtYD X-Google-Smtp-Source: AMsMyM55O9lZw5cMP0sGS70lezEdMaFJqbNOqohGKTruXf/2ZW4wRScGqI6uLcmXCt4+VvYEne/R5TLdIB7b5XWfnHQ= X-Received: by 2002:a05:6870:d79a:b0:136:50d7:faa9 with SMTP id bd26-20020a056870d79a00b0013650d7faa9mr9094115oab.92.1666969831828; Fri, 28 Oct 2022 08:10:31 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 28 Oct 2022 08:10:31 -0700 In-Reply-To: X-Hashcash: 1:20:221028:dev@rjt.dev::4fgLvdDKRY0Mt3MU:79lw Received-SPF: pass client-ip=2001:4860:4864:20::36; envelope-from=stefankangas@gmail.com; helo=mail-oa1-x36.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: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298678 Archived-At: Randy Taylor writes: > Here are some that I had in mind: > - font-lock-escape-face > - For escape characters in strings. > - font-lock-property-face > - Usually an object property, like a member in a class or struct. > - font-lock-punctuation-face > - In addition, we could get even more specific: font-lock-punctuation-{delimiter, bracket, special} > - font-lock-number-face > - font-lock-operator-face I'm not sure we should rush to add a ton of new faces, just because we can. Language modes can still add new faces themselves, so the discussion here is about which set of default faces we should have. For example, is there any benefit to adding `font-lock-number-face'? I don't think I've seen many language modes doing that so far. Is there a high demand for it? Is there a big benefit? Personally, I don't feel confident answering that. Adding a face, especially a default one, is an implicit invitation to theme developers to use it. If we add too many faces, we risk, in the worst case, seeing a proliferation of angry fruit salad. This feature is not even merged to master yet, so perhaps we should take a more careful approach: Time and experience will let us see how tree-sitter is used in practice. If many language modes end up adding a face for something, we can say: okay, now we have proof that this highlighting is generally useful. Let's add a corresponding built-in face that everyone can inherit from. To my mind, doing it the other way around risks putting the cart before the horse. Just my two cents.