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: Standardizing tree-sitter fontification features Date: Fri, 2 Dec 2022 17:12:20 -0800 Message-ID: <5B7EE037-C85A-411C-B42B-1E234EE66DFA@gmail.com> References: <2AEA8AB6-593E-4D89-AB05-0C8EB2BCE327@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="36112"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 03 02:13:15 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 1p1H5f-0009F2-6S for ged-emacs-devel@m.gmane-mx.org; Sat, 03 Dec 2022 02:13:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1H4t-0008Q4-FH; Fri, 02 Dec 2022 20:12:27 -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 1p1H4r-0008Pd-IH for emacs-devel@gnu.org; Fri, 02 Dec 2022 20:12:25 -0500 Original-Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1H4p-0007TK-Sk for emacs-devel@gnu.org; Fri, 02 Dec 2022 20:12:25 -0500 Original-Received: by mail-pl1-x62f.google.com with SMTP id p24so6162082plw.1 for ; Fri, 02 Dec 2022 17:12:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=T93vEOj/36kvMjkpKeepDm8JZcY22CfnoyKaD3fZb6E=; b=D1e25CgXvhqY9Ja1r5pC17D194DOv5CNPwGN6CojkMUhxSbbxIYdx8TR2SS9Y3yuY3 R3tv/nGSHLrcAj+NKlDspkZd+azPp1W4H06V8uhhJfnkOFjs4zH4MsUkDm3fL2jOAz8A GZg85Kk9HxYNYtjl8LxlrGTCyD4romMoXRZHAuEYwLNxyvSeOhPh+6nmFQNqfI/OCstw RkHclB7zE4sE6ZFclXQCHFnloeWf2Qy1AIoHL/lthv+3MQwAOoY5cvRfCbm9nWYzsOPu B/Fm9c1Ub3YiLlS2/2Vr9/mz5I7Uq+kO7HuC4rbpWgBkiuYf+N1URBOwbTPW212RfTJQ Pswg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=T93vEOj/36kvMjkpKeepDm8JZcY22CfnoyKaD3fZb6E=; b=rYgtx/6uRONXcJwuKSi34SHClpIeHPi1mtFtG/B1b7zt4cTA8ubAaAkm+Ewl8hS1UX vbCTQQ7qCzupAT41SSVoL/tpgIU4Bci3RaysHfW9jjmYddOhdvTHuLpWvBkUp9ptzqps gAD0C9oI3GMYjYPeSqkETpG8ToCX96XvO9ezmt+ajy5PQvCnXIzfw1Fjncg2dUAWRfVk cj5K/YT7Ls93Ms10Ur6sQRdcT+0Ln+EOx9a4Tk+gwZE/ROJygZ1llL67nY2iKotGUjlT 5PJERPLxZb6VsynNRfzM6WF4yv/l3bLJeHrcdAHIRnrdw2I0wMVmIpeLfi0XllDp548X 9kSg== X-Gm-Message-State: ANoB5pn/PCt4pmTTN6s5jHl2mEVS2VPB9k06uRgIt/oX5blWyKLA3ZLW 6CyxT1H6nT9UGaE07D2TR3I= X-Google-Smtp-Source: AA0mqf6ibhkfJdTS2/SuaLMv0IinxxT0X+t8sbHzPQWjBDUZUqCb2dZbkUOwvLii4tChZSyGnwns1w== X-Received: by 2002:a17:90a:5a41:b0:219:41ef:a812 with SMTP id m1-20020a17090a5a4100b0021941efa812mr26519563pji.153.1670029942283; Fri, 02 Dec 2022 17:12:22 -0800 (PST) Original-Received: from smtpclient.apple (108-241-83-33.lightspeed.irvnca.sbcglobal.net. [108.241.83.33]) by smtp.gmail.com with ESMTPSA id u64-20020a626043000000b005751f455e0esm5652307pfb.120.2022.12.02.17.12.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Dec 2022 17:12:21 -0800 (PST) In-Reply-To: <2AEA8AB6-593E-4D89-AB05-0C8EB2BCE327@gmail.com> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=casouri@gmail.com; helo=mail-pl1-x62f.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:300855 Archived-At: [Addint emacs-devel back] > On Nov 25, 2022, at 3:20 AM, Mattias Engdeg=C3=A5rd = wrote: >=20 >> Right now we have: > [...] >> comment >=20 > What about treating doc-comments as a separate case? > (May also want to fontify various parts inside, such as doc mark-up = elements.) That makes me wonder what should we do with string & docstrings & = string-interpolation. Should we make them all separate features, or put = them all in a single =E2=80=9Cstring=E2=80=9D feature, or have some = major mode variable to turn things on/off? My thoughts: - docstring is pretty standard for a given language, so they can = probably enabled by default and be part of the string feature. - string interpolation could be part of string feature, but since = =E2=80=9Cstring=E2=80=9D feature is enabled at pretty low fontification = level, I decided to make it separate, and only enabled it in higher = fontification levels. - doc-comment seems rather non-standards, and could even be different = from project to project. So I tend to think it should be turned on/off = by a major mode variable in major modes that support this feature. And = user can enable/disable it with dir-local or file-local variables. >=20 > Otherwise I mostly agree with the proposal but fear that it may result = in an overly busy scheme. Colour only really helps when it helps = highlighting structure, not contents. I agree, that=E2=80=99s why we don=E2=80=99t enable all the features by = default. The default fontification should be pretty sane (IMO). Yuan=