From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matthias Meulien Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration in python.el Date: Tue, 04 Oct 2022 00:47:51 +0200 Message-ID: <87ill0le20.fsf@gmail.com> References: <3A68545C-2E40-4BB4-8563-8041A5452634@gmail.com> <87y1twlr0v.fsf@gmail.com> <83czb8ycpo.fsf@gnu.org> <87tu4klfcw.fsf@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="11783"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 04 00:50:27 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 1ofUGY-0002q0-MQ for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Oct 2022 00:50:26 +0200 Original-Received: from localhost ([::1]:46296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofUGX-0003FU-5P for ged-emacs-devel@m.gmane-mx.org; Mon, 03 Oct 2022 18:50:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofUE8-0001nm-A4 for emacs-devel@gnu.org; Mon, 03 Oct 2022 18:47:56 -0400 Original-Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:46599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofUE6-0005pm-Ah; Mon, 03 Oct 2022 18:47:55 -0400 Original-Received: by mail-wr1-x435.google.com with SMTP id bk15so18734844wrb.13; Mon, 03 Oct 2022 15:47:53 -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; bh=zxCaTAE/8VWfOf08tA904w4sUoON0E5j8qtXbZo3dY8=; b=FkzyrqTMneE+8U2lG7zkC1bORh9lbjaCzMvXQeRxovEHw+LJIMwU3EtMzZvJPnUMVR ynqfNO7b2CRHm/0tT3RdtB35x+d+dt+AuD7+++UkC4aSG2fFqvH6umht2/pAjN+6eyiD /jiQoX6iUonM8Jyn+eYzLmiF9ZSzJ+yO+V33sExYq3tVztrGDmFG/1P9+jHtnofG+6L3 fCEb3/0H7RoDMOMiddWulumQkuIAPwqzc+YaIW3TjLdcX+B6LRU7tJjeOAMTJQviNFXw Rc8Fmc/Ivxa2/JsCmRBvpB4GorYmC7J3WII/2WsEH6qnF03tDShuR5Am+nhB71aM6YRA 9O2w== 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; bh=zxCaTAE/8VWfOf08tA904w4sUoON0E5j8qtXbZo3dY8=; b=vThwGuJ3FEWzLsGX4EqqJflE2aYJMUjtOftAwF6WnJg8ijqO9Mn/fM8lWRSVY2EgN7 gGFiDe0JOr2jonMmpcSRg9WJUtBv4vLZ0/VRcmqN2OuenfdUCmF/rcXNlfVNGvOLNx5b jdT3nHw9UKEuZ0cSvWyu3RaTbnVWj9e9AtIgrI24OAz778ISNx0n5IaDwZTs/ajQckWZ ZKlCXMvHIlJabOtuJb6LMUFN9kTdJG4DjD64L1gW8uzEMixM6xH0LVrPGIecIN6XJWXK fykEsu/0XIBEXuUHvB1+4XGsFbHFb4lGHjeyc66NtUlVouzl2Icv7Awbisd9We8XGdSr Y0Kw== X-Gm-Message-State: ACrzQf1yK1ozBDbpLkSaqdbmkD9zYs/NlqBQ01FQl5laLSUHFyTg5RUc glW0YcOykdGvWJzsYz9az5+dF4boS+o= X-Google-Smtp-Source: AMsMyM6iPum1JRbG56BvuiJ+uWJAh036v13F1OFpD1i8UiH3JOJg779Z+0AA/DCv40Jdzb/MfHbhrw== X-Received: by 2002:a05:6000:711:b0:22a:e78d:be05 with SMTP id bs17-20020a056000071100b0022ae78dbe05mr14730765wrb.338.1664837272416; Mon, 03 Oct 2022 15:47:52 -0700 (PDT) Original-Received: from carbon.localdomain ([2a01:e0a:245:c850:98f5:429a:aa8e:95bb]) by smtp.gmail.com with ESMTPSA id p13-20020a05600c1d8d00b003b332a7bf15sm18713775wms.7.2022.10.03.15.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 15:47:52 -0700 (PDT) In-Reply-To: (Yuan Fu's message of "Mon, 3 Oct 2022 15:31:53 -0700") Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=orontee@gmail.com; helo=mail-wr1-x435.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:296811 Archived-At: Yuan Fu writes: >> On Oct 3, 2022, at 3:19 PM, Matthias Meulien wrote: >> (...) At first sight, moving commands and imenu seems to work as >> expected. Fontification too. > > I didn=E2=80=99t modify and move commands. There are a lot of them and I = don=E2=80=99t > know if tree-sitter would bring any improvement. Imenu and font-lock > are indeed powered by tree-sitter. Ok. Thanks for clarifying. >> I saw small differences between buffers fontified with >> `python-use-tree-sitter' equal to nil and t. Attached is a screenshot >> where one can see two such differences (the third tall buffer shows the >> output of "tree-sitter highlight"): >>=20 >> - line 284: The self attribute > > Why is the _url attribute highlighted? Other attributes don=E2=80=99t see= m to > be highlighted. I guess it's because it is on the left hand side of an assignment. >> - line 296: The variable in the f-string > > That is expected? I added that to add a bit of flair to tree-sitter > font-lock ;-) I like it. --=20 Matthias