From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yoav Marco Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration on feature/tree-sitter Date: Sat, 18 Jun 2022 11:15:22 +0300 Message-ID: <87edzm2vk8.fsf@gmail.com> References: <5bada349-2f43-4325-b696-70918584cd3d@email.android.com> <83mtfsuluo.fsf@gnu.org> <87sfpjhm33.fsf@thornhill.no> <83a6brufe5.fsf@gnu.org> <87pmkmhp8i.fsf@thornhill.no> <83v8ueuc7i.fsf@gnu.org> <73DE25BA-5EEF-4497-8F98-8C5F20853A61@gmail.com> <87v8uewfuq.fsf@thornhill.no> <87mtfkbt9n.fsf@thornhill.no> <1179E1EC-90EF-4989-BE1D-115498F77F60@gmail.com> <87k0ajygry.fsf@thornhill.no> <6EF70929-5759-4F1A-B878-0C1660FB6831@gmail.com> <87leuy5z46.fsf@thornhill.no> <2E68780C-9923-411E-A5DF-B1A54E2EC38B@gmail.com> <83k09fq0am.fsf@gnu.org> <38C272F6-828C-4478-9D90-326AF14D0C94@gmail.com> <87h74j2lin.fsf@gmail.com> <4C257709-0E3E-46A7-8CEB-569001EEE31D@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="23174"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.3; emacs 29.0.50 Cc: Eli Zaretskii , Theodor Thornhill , Stefan Monnier , Daniel Colascione , emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 18 12:16:03 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 1o2VUp-0005si-JY for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jun 2022 12:16:03 +0200 Original-Received: from localhost ([::1]:54372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2VUn-0003Ft-VE for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jun 2022 06:16:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2UM1-0005F7-US for emacs-devel@gnu.org; Sat, 18 Jun 2022 05:02:54 -0400 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:45797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2UM0-0002mM-6H; Sat, 18 Jun 2022 05:02:53 -0400 Original-Received: by mail-wr1-x432.google.com with SMTP id n1so8146961wrg.12; Sat, 18 Jun 2022 02:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=gRybJwqvqsN9vuSLGTyVHQoonnWcIyX2hkhOQrsWxbo=; b=HPdc1OFgR/ybuQ33PFQJkqgHPIClK4JhVD7HzaNP/WfKUMEk80/b+82AVfeuVZwsBe SNdDQmkOYBjJ8oxVM0ip5HwV2T40epWYJ4GiNP/Crw8SONcKpOzG8M4VI8AnQJwDhlws xHCIX1IvNsx1gNIHDTaYPkLE/OlnK0VnAlTB4UobkoxD5VdZc2XIHMRO7tiMYYBo4D7v 8yNZFOm9cQ+do9+rdv8XM2ycSvAbybqjhmHfejHdgmrIWpSPruDW1bSgsOsqvBf4pZom oX+FEfZ154TsTLLsWBunogWPT/nej980ZCiCnc46MMSJKzALeN4kiTFpvpgbkMe1RDoq AE9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=gRybJwqvqsN9vuSLGTyVHQoonnWcIyX2hkhOQrsWxbo=; b=nWevXiK5Q/ViIjlXR2w+DqFOcVhLwRrcHXEKYDwyXPXrGB/zgUbwXpE8OOnXbM04Wi FgwTvULSBbhEaLMl4ER125IG7M5jWfAfHL0xXLGRBFerqZHyx+wfEkU1XRqPFZjV+puS A1hJofIFxgc/Geqe2NZDJAQrRjSaT8e3cJdgHAjmsGKRawnMEBYoiA/xH/1m49LnL6/5 uENO0S7wna1nCA6gd+Fv30ZtpkTOwoBMKmVK5yLTBlZ5NZZjjQkEt/J/2eniaaN8LUUS YakpegO/Tx7tIn/0Ou0ovLKIjSXKMtw3EqUWJBP+chJpYc1OC30zq6uzIEjcp3iQkzUd S4Bg== X-Gm-Message-State: AJIora8phc+jJ2u613m9BOcTjpu3GlCPPGvva3YXr1l++QY3bfD4qJc5 +gXOq3QzggWqt2SmpXTAwKA= X-Google-Smtp-Source: AGRyM1vkA5pRgAgKU2SKhHpAOwyxwwOPMcqfyScs0YLf83Iz71uYqzXCu5HedwcxR1aiUGdNfJz5+g== X-Received: by 2002:a5d:4202:0:b0:21b:6360:3cfd with SMTP id n2-20020a5d4202000000b0021b63603cfdmr5886982wrq.122.1655542969613; Sat, 18 Jun 2022 02:02:49 -0700 (PDT) Original-Received: from localhost ([77.126.9.181]) by smtp.gmail.com with ESMTPSA id o8-20020a056000010800b0021b84ac7a05sm2154736wrx.0.2022.06.18.02.02.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 02:02:49 -0700 (PDT) In-reply-to: <4C257709-0E3E-46A7-8CEB-569001EEE31D@gmail.com> Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=yoavm448@gmail.com; helo=mail-wr1-x432.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 18 Jun 2022 06:14:35 -0400 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:291351 Archived-At: Yuan Fu writes: >> That reminds me -- Yuan, have you seen my PR to tree-sitter-langs, Hacky >> support for treesit in Emacs core [2]? >> >> It uses tree-sitter-langs' groundwork for fetching grammars and >> packaging highlighting queries, but uses treesit instead of the >> tree-sitter dynamic module. >> >> Enabling highlighting is just M-x treesit-langs-hl-mode in major-modes >> that tree-sitter-langs supports. >> >> [2]: https://github.com/emacs-tree-sitter/tree-sitter-langs/pull/99 > > Ah yes, I=E2=80=99ve seen it. I think the part that automatically downloa= ds and builds > language definitions is very useful. It cannot be in Emacs core because we > cannot distribute language definitions, but it could be a very useful ELP= A or > MELPA package. Yeah, I agree. tree-sitter-langs makes it very easy to use elisp-tree-sitter and now also the newer treesit. > The part that automatically generate highlighting is also useful, > but I=E2=80=99m not sure how would we use it. A little neatpick -- it doesn't really 'generate', just converts tree-sitter-langs' hand-crafted highlights.scm query files to be usable by treesit too. > We probably don=E2=80=99t want to add a tree-sitterify-mode that just ena= bles > tree-sitter highlight in a mode=E2=80=94I prefer that we change each major > mode to use tree-sitter features. I agree, though since grammars aren't packaged with Emacs, major-modes that *are* packaged with Emacs would need to only use treesit when the grammars are avaliable. Or do we expect grammars to be a dependency when users are installing Emacs? > Also I think it makes more sense if you just fork it rather than making a= PR. Yeah, I don't really expect it to be merged. My reason for the PR is for it to be more of a talking point about collaboration between treesit and tree-sitter-langs. I used elisp-tree-sitter before trying the feature/tree-sitter branch, and I really like the richness of its highlighting (which comes from the highlights.scm files). Yoav