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: Tree-sitter integration in python.el Date: Sat, 08 Oct 2022 09:30:21 +0300 Message-ID: <83wn9altdu.fsf@gnu.org> References: <3A68545C-2E40-4BB4-8563-8041A5452634@gmail.com> <87y1twlr0v.fsf@gmail.com> <83czb8ycpo.fsf@gnu.org> <87tu4klfcw.fsf@gmail.com> <87ill0le20.fsf@gmail.com> <87y1ttfmj8.fsf@gmail.com> <19950F30-F4DB-4CE4-9257-24DA39594669@gmail.com> <87czb47jya.fsf@gmail.com> <87wn9c7xxd.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30183"; mail-complaints-to="usenet@ciao.gmane.io" Cc: arstoffel@gmail.com, orontee@gmail.com, emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 08 08:31:49 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 1oh3NE-0007ep-Hh for ged-emacs-devel@m.gmane-mx.org; Sat, 08 Oct 2022 08:31:48 +0200 Original-Received: from localhost ([::1]:55032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oh3NC-0004QG-It for ged-emacs-devel@m.gmane-mx.org; Sat, 08 Oct 2022 02:31:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oh3Lq-0003Zb-N0 for emacs-devel@gnu.org; Sat, 08 Oct 2022 02:30:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oh3Lq-0004PD-BC; Sat, 08 Oct 2022 02:30:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=PDqKcOMDHCMIlIOR3wiCvt0IVcnVfO3Yqv8IzGf7oFU=; b=gxHpN/CjY4JNwIVme0oS nAvLWpgHfRonVFQMKf5DH5/7dJHgJArAP4v+2CBIkcopXqRYGjcQhVMp3FloUCOLXJ02W8RDzfsqH aYol2CqE4gpDSyAUSV+QM6qFL5891k6d3B1fOf3Aluu9yHXfA277ptYDqX2MAd3RqGayiugj9KyW2 WTn8+wbqZdIFCPaYwM7XFtmSR6GXRY4JiX+lVdBXuZ6FRrBibThikFREf+KADhGDy07VGgYIghKBK yz1lBJkRLf2fM2sCjpOQP/ps6viwVtpkqhe2K5cbt8A3bLAoxsbCR1/FV4Po7R6H/r8X2aEBsoNfX o/gAcnGsZbN7QQ==; Original-Received: from [87.69.77.57] (port=4164 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oh3Lo-0007gT-IS; Sat, 08 Oct 2022 02:30:21 -0400 In-Reply-To: (message from Yuan Fu on Fri, 7 Oct 2022 15:10:10 -0700) 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" Xref: news.gmane.io gmane.emacs.devel:297190 Archived-At: > From: Yuan Fu > Date: Fri, 7 Oct 2022 15:10:10 -0700 > Cc: Matthias Meulien , > Eli Zaretskii , > emacs-devel@gnu.org > > The complaint for font-lock-maximum-decoration is that it’s obscure and too corse-grained. So my idea is for each major mode to provide fined-grained controls like python-fontify-type/f-string/assignment/built-in/etc. And tree-sitter makes it easy to implement this kind of toggle. But I guess a global control is also nice, I can make tree-sitter respect font-lock-maximum-decoration, in addition to the fined grained local-control. I think having tree-sitter respect font-lock-maximum-decoration would be good, because it allows a major-mode agnostic way of controlling fontifications. With tree-sitter in mind, we'd need to agree on what kind of syntactic entities are included in each level (which is also a Good Thing, because currently what is level N of font-lock is entirely up to the major-mode, AFAIU).