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: Fri, 7 Oct 2022 15:10:10 -0700 Message-ID: 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 (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="33788"; 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 Sat Oct 08 00:10:56 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 1ogvYW-0008e7-C8 for ged-emacs-devel@m.gmane-mx.org; Sat, 08 Oct 2022 00:10:56 +0200 Original-Received: from localhost ([::1]:45080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogvYU-0004UD-PW for ged-emacs-devel@m.gmane-mx.org; Fri, 07 Oct 2022 18:10:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogvXr-0003oi-Gd for emacs-devel@gnu.org; Fri, 07 Oct 2022 18:10:15 -0400 Original-Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:37382) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogvXp-0004Mi-Mx; Fri, 07 Oct 2022 18:10:15 -0400 Original-Received: by mail-pj1-x1030.google.com with SMTP id p3-20020a17090a284300b0020a85fa3ffcso8394332pjf.2; Fri, 07 Oct 2022 15:10:12 -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=2aqekIQwh7TYPvQ8gN3henpjWDXAjDCeNN7ybmyBT1M=; b=mcSIi2jyFdXj4uzt8R3ALn6/+pbHtYiUf4CKi724F5gkFQiZRXEtDWFFBnwvMMYZtN q6+aOpsYaDt/oCvgAH9IclEVc4VFZxtIMxPgHzrQeoDJcgsh/F0tJsRlCcMHHswvPXi+ vvUCfHhlA3Gsg/R1pUy9Jrn4ql2yr0iPYiO3U4VNhuL4uC9a3kLSlfO3HztLFMqzaSTD El9G24Eh/iaGZGMEtfH8qBUO4XTtvFH/FFM71CQ/0HITAx1m05tIlai3g3Q8XlVdlggx Q5sQWdLSOSRiaaLaRQXVtaUSamJOAVMURje8q+H3mSBc7otAtEywlpxhKuXUagyGyv48 xwJQ== 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=2aqekIQwh7TYPvQ8gN3henpjWDXAjDCeNN7ybmyBT1M=; b=OZh4xPE22p7IcYZopsGBLExVWn8++tQin7g83lMZLlxgB4JMis0IM/kAGxrcBbjrnF hGqdOMcKUH7vnRrhSsqj14iG1ThCfjswmJCKl9zVyfNm7OhelvBm6sGwktyb/kku7D1o Nxg+ws8NOPOVGv7G+om2DSX7ercfZO75Fb4q42n0sAUyHXo6IIfrwe9uMjjKQ/+Scmnj tvKqD0ChW9hQgkZoviuqIp2eBhtBAbUoDei3eV3WpdeE1+cKdsuenvVWeLHvSYV9gMYK vfB+NfAVYGP7UeA5TMqDG26kUW+l3RgNTp5JD7tjXdxNguBZGY5pKMq4Kg7OJLtBvxfk kWWA== X-Gm-Message-State: ACrzQf2YxGlt0RAMi+seDbNFLtizBhsflgN6MWUYStFAUnRsqOIVHih/ iabdroAOvQsvazvJ31lHUpY= X-Google-Smtp-Source: AMsMyM5nbIuUJfQR15uEw2SxkOwSatRA3fN7m3b5EoQjjbxEn/BwoaB10DwZzkT7Ts0bpIMvTZu1mg== X-Received: by 2002:a17:90b:350d:b0:202:ff91:a0bd with SMTP id ls13-20020a17090b350d00b00202ff91a0bdmr18942054pjb.46.1665180611936; Fri, 07 Oct 2022 15:10:11 -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 i66-20020a626d45000000b0056276759957sm2150643pfc.141.2022.10.07.15.10.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2022 15:10:11 -0700 (PDT) In-Reply-To: <87wn9c7xxd.fsf@gmail.com> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=casouri@gmail.com; helo=mail-pj1-x1030.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:297171 Archived-At: > On Oct 7, 2022, at 3:03 AM, Augusto Stoffel = wrote: >=20 > On Fri, 7 Oct 2022 at 01:25, Yuan Fu wrote: >=20 >> Yeah, with tree-sitter, fortifying types is trivial. In fact all = types >> should be fortified already. (I tested with some simple examples.) >> Should we provide some variables to toggle fontification for = different >> things? Like python-fontify-type/f-string/assignment/built-in/etc. >=20 > Looking at the screenshots posted a few messages back, which are VERY > busy, I would really appreciate an option to disable a few = fontification > rules or, conversely, disable all but a few of them. Ideally, this > should be done through a generic mechanism that works across major > modes. >=20 > Have you seen the new `font-lock-ignore' option? Tree-sitter could > provide something similar (and much better/less hacky). The complaint for font-lock-maximum-decoration is that it=E2=80=99s = 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. Since we are designing a new system, I don=E2=80=99t think we need to = resort to the likes of font-lock-ignore. Yuan=