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: Tree-sitter integration in python.el Date: Tue, 11 Oct 2022 22:08:52 -0700 Message-ID: <730522AC-821C-4346-A8D5-CA43EDDB44E0@gmail.com> 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> <875ygu91z4.fsf@gmail.com> <9D398D49-0CA3-4CBA-9820-728E4A6C9568@gmail.com> <874jwcf8s0.fsf@gmail.com> <3DA867E4-2C37-400C-8BB3-3E72D6C8F8A9@gmail.com> <87lepnektr.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30925"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Matthias Meulien , Eli Zaretskii , emacs-devel@gnu.org To: Augusto Stoffel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 12 07:10:41 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 1oiU0u-0007x7-UQ for ged-emacs-devel@m.gmane-mx.org; Wed, 12 Oct 2022 07:10:40 +0200 Original-Received: from localhost ([::1]:33758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiU0t-000217-Cf for ged-emacs-devel@m.gmane-mx.org; Wed, 12 Oct 2022 01:10:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiTzH-0000po-HZ for emacs-devel@gnu.org; Wed, 12 Oct 2022 01:08:59 -0400 Original-Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:35746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oiTzF-00084K-53; Wed, 12 Oct 2022 01:08:59 -0400 Original-Received: by mail-pf1-x42f.google.com with SMTP id y191so74884pfb.2; Tue, 11 Oct 2022 22:08:56 -0700 (PDT) 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=9FxZogbSyg9qxmLD6dkCdIvaAhLyicHQdFy+vi2osl0=; b=oVM+yFzhP1BeRclOoqtP+5Lh2+5tzHdzdfZ/HW1g3R+3yajJzd5ki9M4aaETtkU45o 6l4OwnxCvL0G8jcVd/LOXIdkIzQ0dMuQaApUEv2H3zoaGomKQE+/Kbqkec5qRn1A0ian 9eRV7YkdgDOD06ISIV5HxXIm/BHyDVpLQi8Nd7vUTcSwnMO2H15JWsX1QvnI6Pvcjp7L Vd/b63Ey1jdNrX8VLV1jzatiCSM7R+ypjI4zCvBVAZLAC28MtWrUE4wat3J5datrCrkc iHBulIib2J/g5cUyh2kik6isidvD9qJoYHrVNL8JwUyp2SBBl3/VbfDV+LVlysmx8ESj zuDA== 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=9FxZogbSyg9qxmLD6dkCdIvaAhLyicHQdFy+vi2osl0=; b=MrXP9LCs9l899NdQmyUu4B7uxyp+AzYBla8s8eHpFYhsf7D7UoTNiPxZqw3iADKn0F 7vD4P3hOCGBRS38iOmyYLCt+h5IisS1NO0C/mKe5/abJn5YJEzcDplCwSnLqmdIfb4te ZrrX4BvDK9N/JQ0HLcIvELutyfAZJ9c+ATNXZ2gLJXYirFsjeXQ7JTKvALiEHQGvBIew IspziG06Tjd/GRTw/EUN7aOMwj1gCX+yV6TxUPfwSDLBp0dgGnig6Oh038R1ALC1RJcE q1D3orXSyVo1hkdPY7pqMk78zot1rVH6hUhERr2TOnUe1cWmc06xT3S4Xg1gNsY8aYl6 p7LQ== X-Gm-Message-State: ACrzQf3UFpu6uDb21A04rIVGunEW4HMLm4Navtqt2Oxb5nc38W0i481Q 2SYrykwYc2/LjAaZNJ858Xnpta7YF+NqMQ== X-Google-Smtp-Source: AMsMyM7bkusHC7aNG2BcaoZxTfWAQyh4yAJJntIXZ+2Rt4dRgFeA+GfP8ZrHVRQa0dXtMw1TkAX8lw== X-Received: by 2002:a63:4c2:0:b0:460:869a:f5ba with SMTP id 185-20020a6304c2000000b00460869af5bamr16627416pge.362.1665551335332; Tue, 11 Oct 2022 22:08:55 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id z20-20020a63e554000000b0046a1c832e9fsm442887pgj.34.2022.10.11.22.08.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Oct 2022 22:08:54 -0700 (PDT) In-Reply-To: <87lepnektr.fsf@gmail.com> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=casouri@gmail.com; helo=mail-pf1-x42f.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" Xref: news.gmane.io gmane.emacs.devel:297567 Archived-At: >=20 > Now, concerning font-lock-ignore: why do you say you think something > like it is not needed in tree-sitter? Do you see no need for a > fine-grained customization option for font lock, or do you have a = better > implementation of fine-grained customization in mind? >=20 > I'd say a fine-grained customization option is very much needed. > Requiring the user to advice `treesit-font-lock-rules' is to high of a > bar. `font-lock-ignore' may not be incredibly easy to use (the user > still has to look at the font-lock rule definitions), but it's = flexible, > has a simple implementation, and imposes no extra work on the = major-mode > developer. >=20 > You can probably just stick a call to font-lock--filter-keywords > somewhere in treesit.el and call it a day. Currently we have :toggle variable, which let variable control whether = to enable a query. Major modes could sever font-lock into categories, = each controlled by a variable. Eg, python-font-lock-type, = python-font-lock-assignment, etc. I think that should be more than = enough as long as developers bother to create these toggles. Yuan=