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: Sat, 8 Oct 2022 13:57:19 -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> <83wn9altdu.fsf@gnu.org> 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="5933"; mail-complaints-to="usenet@ciao.gmane.io" Cc: arstoffel@gmail.com, orontee@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 08 22:58:05 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 1ohGtY-0001PO-0G for ged-emacs-devel@m.gmane-mx.org; Sat, 08 Oct 2022 22:58:04 +0200 Original-Received: from localhost ([::1]:53742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohGtW-0000Sd-QH for ged-emacs-devel@m.gmane-mx.org; Sat, 08 Oct 2022 16:58:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohGsv-0008Ck-K3 for emacs-devel@gnu.org; Sat, 08 Oct 2022 16:57:25 -0400 Original-Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:43800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohGsu-0006ss-0T; Sat, 08 Oct 2022 16:57:25 -0400 Original-Received: by mail-pf1-x42f.google.com with SMTP id 204so7695523pfx.10; Sat, 08 Oct 2022 13:57:23 -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=rSCOGg4CcuSW6rRh55Ab+3ylcd00LW4MaVFsm9rTyDw=; b=JcaYXJH1k/DxUOMpo7pE014LQtvktHdhz2OxJbxCW0A4snIa45dkqjcmpLVLx3GqGq olhLtawQPGRH/yFy/6o0CtxcrND7DOQjRLZe6nZ2ioTIZ4gZLM7LwbYlVPFl0y054mAf lWGI7okvSdh0bH9OreGwYzOpzhJ1q64c6vm1MzpenReBtqsVo6bc5dQLXRx4p0Hji70N J3dYtjhHYmi9c65UCO5qhi/bh24xLGfLG+ekOJMmu23iCD9X0zPoMoyMSROvYa1MIcDQ dzBZrIrt9spef9LwZK+hLPhlPfHbp6/VAynO3ZPCxSQPdo98dhZ28NHjWkoBUgbli249 Qlpw== 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=rSCOGg4CcuSW6rRh55Ab+3ylcd00LW4MaVFsm9rTyDw=; b=ua3oggZVtgMmjoTvYu3NZ+UMGZvUb0RQBoJzdu/pLHJS0Ol0DkB6MeCrKB2f97gQON ugrHKU9pFXP9cSIYbCYys5o0MzrL7jfohwIuRxAkAgDhAuN6mfCAbBOREeK6TLIlqs8A 2kkF7sRX8k8MRrtV8Dk2aG7sF36JfhiglAtdZYiZBYLpqUX8LqpJJD0BJ+iisZEsjaHW bTp0MuXr7HFZhuCuvAoj9HX58Jz9Fb48Zlwpt8u+fxbypfj2FjhWKcbRGYxNQdIuTuPm BwY7ubw4gTVQNNutssxjVCk4lclXSRBFKuME/o/xNP2XdJA/ybZeNvNHwsDwkpMFiaxa 3HkA== X-Gm-Message-State: ACrzQf2t9Cr8LYgCrm/E2ootI4yvHexzxB1xdqS+KElJSnSC5BewcbUt leXbp6Flj+gdAbk9L5Cx5MXV0MJMc8Q= X-Google-Smtp-Source: AMsMyM70FDjNoboK24Zlt2w1dc2poPxwyRIx1SlTJpHleS0AfRtf91ZfthQvQxX/BaiRX9pPzfAysA== X-Received: by 2002:a63:550d:0:b0:43c:1195:5c1d with SMTP id j13-20020a63550d000000b0043c11955c1dmr10042074pgb.84.1665262641673; Sat, 08 Oct 2022 13:57:21 -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 u3-20020a170902e5c300b0017f592a7eccsm3726404plf.298.2022.10.08.13.57.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Oct 2022 13:57:21 -0700 (PDT) In-Reply-To: <83wn9altdu.fsf@gnu.org> 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:297222 Archived-At: > On Oct 7, 2022, at 11:30 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Fri, 7 Oct 2022 15:10:10 -0700 >> Cc: Matthias Meulien , >> Eli Zaretskii , >> emacs-devel@gnu.org >>=20 >> 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. >=20 > 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). I think it is difficult to define syntactic entities for each level such = that it is generally enough to include all kinds of major mode out = there, and specific enough to be useful. It is easy for common = programming languages, but hard for others like html, css, prolog, etc. My impression of the levels are 1 for absolute minimum, 2 for moderate, = and 3 for maximum. I don=E2=80=99t know if any major modes uses more = than 3 levels. Perhaps rough guidelines like this could be more helpful = than specifying syntactic entities for each level. Yuan=