From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Standardizing tree-sitter fontification features Date: Thu, 24 Nov 2022 21:56:32 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19804"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 25 03:57:09 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 1oyOto-0004zs-Sn for ged-emacs-devel@m.gmane-mx.org; Fri, 25 Nov 2022 03:57:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyOtM-0003qD-0A; Thu, 24 Nov 2022 21:56:40 -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 1oyOtK-0003q2-J8 for emacs-devel@gnu.org; Thu, 24 Nov 2022 21:56:38 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyOtI-0002ko-SI for emacs-devel@gnu.org; Thu, 24 Nov 2022 21:56:38 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C14BF4416F6; Thu, 24 Nov 2022 21:56:34 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 40814441625; Thu, 24 Nov 2022 21:56:33 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1669344993; bh=u5q4GKiREUmOapeuRSE8peyu/RK6tg/aycKfnO6S2kE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=XuXL6Og+5HmdDI+SOVB2cVVaG9pLdwpDOuFNIaJr2UM9B8vP/R/b2DA1o49zm9os+ g5VfZqn+VPjdRhJQFPXhEn8a1aZosfUjiOmEdWz3DGEyIhjB09JfQD/twJ70wWqDkg iCTyr14WDA5WJ+QMmVwX3Le94RQGWd1V3J8JpqESev1Z0cOrP10YBMz0XKaTWXGFkO pP4SH8LoorYuxxoNfXX7YhRocp9PjKBhHoJfJC0uCllobs2Xme1QNBYgHKndpyoEV0 yJO/kA+8383x8rEo9W07CB3RYkNEyaKXLXKcTHudu2MkEu7DrWyOvmOD2JVc0hD0oP +B0WIOhIxA11g== Original-Received: from pastel (unknown [104.247.241.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id F31C412047D; Thu, 24 Nov 2022 21:56:32 -0500 (EST) In-Reply-To: (Yuan Fu's message of "Thu, 24 Nov 2022 14:16:02 -0800") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:300457 Archived-At: > Basic tokens: > > delimiter ,.; > operator = != || >From the grammar point of view, both of these are simply infix thingies. Defining precisely the difference between them can be a bit more delicate, tho. I guess intuitively the idea is that "operator" corresponds to some kind of run-time operation whereas "delimiter" serves only to figure out where things start and end but doesn't do anything in itself. Not clear where the `=` used for definitions (as in "let x = foo in bar") should fall. Same for the "," used to construct pairs or the conjunction/disjunction in Prolog written `,` and `;` respectively :-) > string-interpolation f"text {variable}" > escape-sequence "\n\t\\" > function every function identifier I think we definitely need to distinguish a reference/use of a function from a definition of a function. I do want my function identifiers highlighted in my function definitions but *not* in my function calls. > variable every variable identifier Same here. [ Note that in many languages (e.g. Scheme and C), functions and "variables" are the same (i.e. Lisp-1 in the world of Lisp). ] > type every type identifier And same here as well. [ I will spare you the discussion of what should happen for dependently typed languages where types are "normal" values. ] > Also, some of the features are very busy, it would be good if we can disable > they by default. The default value of font-lock-maximum-decoration is t, > meaning use everything, which is not very helpful... If you compare the "style" of font-lock rules used until now to those provide in the new tree-sitter modes, I think it makes sense for tree-sitter modes to default to "medium" decorations. Stefan