From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration in python.el Date: Mon, 10 Oct 2022 17:53:52 +0200 Message-ID: <87lepnektr.fsf@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> Mime-Version: 1.0 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="4136"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Matthias Meulien , Eli Zaretskii , emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 10 17:57:55 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 1ohvAA-0000w2-EU for ged-emacs-devel@m.gmane-mx.org; Mon, 10 Oct 2022 17:57:54 +0200 Original-Received: from localhost ([::1]:59774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohvA9-0003aA-19 for ged-emacs-devel@m.gmane-mx.org; Mon, 10 Oct 2022 11:57:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohv6X-00074q-Pa for emacs-devel@gnu.org; Mon, 10 Oct 2022 11:54:09 -0400 Original-Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:39813) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohv6V-0002ic-7f; Mon, 10 Oct 2022 11:54:09 -0400 Original-Received: by mail-ej1-x633.google.com with SMTP id b2so25803165eja.6; Mon, 10 Oct 2022 08:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=phbwQr31qP3FW+TlLSqGx+cRs+0QC/tYxpYtA7V4fcc=; b=dh2kAml8lYAsdvioPVTqfJNCSr4ePJpmftWCTaYOYTio5l0l28+xuAfldv3Sn7ssQc Nzdc2/qMAssAXfSXEmvpn3uDo7xbR0KTnIa2JD/4rpN25o+A1mz9uqGcY3wS9yx8vSkF fHjrDO+FcaZp+tcqs1VCtIKRHZ1EqXePR4RoY4z3EmqCmIz0cf4tyQUDJw6o86nf/RSd Kqi/SaenyEfrW2iKCCdTOZvhghs/GOeypRRHWjg0S2Mx76n2tV3Hvx9VSL0ZfTcNuB/4 qQjky5ZGWh0rO9D23lSZvAq2Hln/ZUQyLCjSqv1k0R5Nmdo0fHnsKMlv+mD8BJ9o0qoO FfhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=phbwQr31qP3FW+TlLSqGx+cRs+0QC/tYxpYtA7V4fcc=; b=6FHK7A2cHyIHrI/Y4eF8v86JfBZNjhm2hwAB9DpcnN02Sf0fFT8xWZaW/DSwaGkRPk dZ5fF1R3PtIyDWbx/RrUSQcv8TlnxzEn5pAtE43r5hSwc29qnFC7Zg+28rAm4Lzuq3Xx OK/egQe+qn6hYcgxusUF2P/43QU9zwQ1Vzg0cbd7YqqFYTDoGCGDy4t0v+4vivX6hbO0 CHaGruoShuLNz3nKHpTO6Uy/hWkbq8Pu6r0atF8q0XXEyyNV87wXr6dFWZGtYVoQUgrg wxK4MgvSpQx5s3dxBedKMO5MgZ1EVz0XvIYf43LdXiW5EqPydv3t2av7P/u9GmMboHxy S3fg== X-Gm-Message-State: ACrzQf2lWHJSRnAHQqu9KF5bw8ixfliJGMPuTiWGMTlmkUEGvwmqq3/J gEw6DDCZU++wuoJlCPykX26DW91ckso= X-Google-Smtp-Source: AMsMyM7kPG+HWGqcZPQor8Ip5KEuobMJ8K7Fx0YaCNe3id+jCkNVISfb3tHaGX0TcvjtABP8Zb8E7g== X-Received: by 2002:a17:906:5d16:b0:783:78d5:e47a with SMTP id g22-20020a1709065d1600b0078378d5e47amr15384437ejt.453.1665417234523; Mon, 10 Oct 2022 08:53:54 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::89aa]) by smtp.gmail.com with ESMTPSA id v2-20020a50d582000000b00443d657d8a4sm7321925edi.61.2022.10.10.08.53.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 08:53:53 -0700 (PDT) In-Reply-To: <3DA867E4-2C37-400C-8BB3-3E72D6C8F8A9@gmail.com> (Yuan Fu's message of "Mon, 10 Oct 2022 08:10:32 -0700") Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=arstoffel@gmail.com; helo=mail-ej1-x633.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:297377 Archived-At: On Mon, 10 Oct 2022 at 08:10, Yuan Fu wrote: > I=E2=80=99ve added support for :level in treesit-font-lock-rules, yes ;-) Nice, thanks. 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? 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. You can probably just stick a call to font-lock--filter-keywords somewhere in treesit.el and call it a day.