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: Fri, 17 Jun 2022 21:12:22 +0300 Message-ID: <87h74j2lin.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> 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="21723"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.3; emacs 29.0.50 Cc: Eli Zaretskii , Theodor Thornhill , monnier@iro.umontreal.ca, dancol@dancol.org, 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 07:52:19 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 1o2RNa-0005T3-Th for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jun 2022 07:52:18 +0200 Original-Received: from localhost ([::1]:56902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2RNZ-0003hM-8C for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jun 2022 01:52:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2Ggy-0000m4-2i for emacs-devel@gnu.org; Fri, 17 Jun 2022 14:27:36 -0400 Original-Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:44621) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2Ggu-00081D-W2; Fri, 17 Jun 2022 14:27:34 -0400 Original-Received: by mail-wr1-x42e.google.com with SMTP id g4so6741007wrh.11; Fri, 17 Jun 2022 11:27:31 -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=fwHoJ2KhYwwS+IO7MDyvmg8X3OD3ge92kM1K2Fw2kNU=; b=nYx67bnNEL1A/0KhfBzt4ypqpNqm4JCDvecadYnRnnD1iaSlCROsj/I6t0eg1O148e A74LQ1/Vg1BXxWLA9dAIqjIUykF2us0vNczhWj43vLY5edKXOsfTycclCZwAHnclJfXS i+R+tm6a3NZCLqMLzUzCFGb/yPadtPPxq/FzemaGoz/FSbvEuoR2R6OC8GOipEZQKO4x XkMgz8xi2Rm7bunO65P8xghCFclu34n94p2RAy+lQ9+OEaXrv6u97hjMyZoB6ZZn73b3 rPDOFNnBQQfNbXFXFIePq7jT1ZOvCyx5gHnaGDdWfA9ls6xBUxdHmQTwCpHDg4NPquH0 BPcA== 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=fwHoJ2KhYwwS+IO7MDyvmg8X3OD3ge92kM1K2Fw2kNU=; b=GOShXeZhqI0MpTSJFt0Eum9vx3hNOPrvORR+cnSq0d0HEdUdp+tJZ0UDegP8J/EQzf nh1GSrLETwPKWgfFJbzRgnlam8wS+xCNT9SN3AtrbLi+l9rexCJNLVxVSNqC30iUCv1x TkfKo1olPxWSCr2h+XnWnGB/rV6CSzwkQrUv4BGU2aCM06sKgPjiPvatFMcY2FJ76bkj 54ipWTZtuXgGpAV5/9kTum56Bh8sUc4/Do8BurTdqUkHhIoGZHb15rGtG3p4JB40HCc2 bQTiDWBbrNlF/4GMjVv9HUVLJ2ZaEjD8JDJLHXBXuoip4du65HvG0HxP6tl6r6njzCpJ 3CQw== X-Gm-Message-State: AJIora+MbTKzTQH9dwFN7eujA670a0mDja/srKc9vVMp6rn8y4MmMqGS vb9opzyMS7LV64s+tzD1Gd0= X-Google-Smtp-Source: AGRyM1vsznCQiugxqKYIEQjYCnTcUPfp6qYET+7LVC46yTO2K5DWxlofvcAQWFKHqqYNNQm2dXuXsA== X-Received: by 2002:a5d:584c:0:b0:218:4e98:770a with SMTP id i12-20020a5d584c000000b002184e98770amr10326247wrf.271.1655490450524; Fri, 17 Jun 2022 11:27:30 -0700 (PDT) Original-Received: from localhost ([77.126.9.181]) by smtp.gmail.com with ESMTPSA id k24-20020a05600c1c9800b00397122e63b6sm6838233wms.29.2022.06.17.11.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 11:27:29 -0700 (PDT) In-reply-to: <38C272F6-828C-4478-9D90-326AF14D0C94@gmail.com> Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=yoavm448@gmail.com; helo=mail-wr1-x42e.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 01:42:52 -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:291332 Archived-At: Yuan Fu writes: >> On Jun 16, 2022, at 11:19 PM, Eli Zaretskii wrote: >> [...] >> I mean, what should a user do, after >> building the branch, to start using the features backed by >> tree-sitter? I presume the list should include downloading parsers >> (any recommendations for the relevant sites?), compiling them (or >> maybe there are sites with precompiled ones?), then setting some >> variables or data structures in Emacs or invoking some commands/modes? >> >> I think something like that will be useful for more people to try the >> branch, provide feedback, and facilitate making its more stable. > > I do have an article that covers many of the topics you mentioned [1]. Bu= t it > lacks =E2=80=9Chands-on=E2=80=9D details, and it is a bit out-dated (repo= sitory moved, we > changed the prefix, etc). I can update it with, say, a starter guide on > implementing a minimal tree-sitter C major mode. I=E2=80=99ll post back o= nce its done. > > [1]: https://archive.casouri.cat/note/2021/emacs-tree-sitter/index.html > > Yuan 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