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 on feature/tree-sitter Date: Sat, 14 May 2022 08:55:31 -0700 Message-ID: References: <9E6D13F6-7E50-44EE-A357-C971A11A3636@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.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="19224"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Devel To: =?utf-8?Q?Daniel_Mart=C3=ADn?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 14 17:56:44 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 1npu8J-0004oX-QJ for ged-emacs-devel@m.gmane-mx.org; Sat, 14 May 2022 17:56:43 +0200 Original-Received: from localhost ([::1]:51428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npu8I-0001KC-RW for ged-emacs-devel@m.gmane-mx.org; Sat, 14 May 2022 11:56:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npu7F-0007e9-Tt for emacs-devel@gnu.org; Sat, 14 May 2022 11:55:38 -0400 Original-Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:41937) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npu7D-0004K7-D2 for emacs-devel@gnu.org; Sat, 14 May 2022 11:55:37 -0400 Original-Received: by mail-pl1-x636.google.com with SMTP id s14so10654168plk.8 for ; Sat, 14 May 2022 08:55:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=SbRVkiRhwns7jEw/PUyLKxdU48NzUP6Ar59FQupb+pI=; b=pNFShCpcrF3vuy2dy+UwtQIkAIVPIJMdimIGuahlTZqQl5dHG7aL7FwdTyZ3dYrFtb bjAcHlPEvijI0FLeDzjuURYr5gEm9DO0zGcM0bJtUYjkRoS37Tct6bc6/3fEuMU8CII5 +eVwqNfH+ob5LEnzMkm/vCdoGs4+5fMDixEOiBxAooOwsOiTkgeWrBfjJSjbhHqhygCj WGO3UnirUYjh0waBg71APaUZx7k/gdgjAtUvkMcPrQl8HCLyQGZ1RWT6JMCwjbSGZfgj K7LFjIHZBUs9jQXkgJRq0L0+mKQ6YNsnJnupM60qienTfDVMWkqg6LjDsic321hZA8cL ATvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=SbRVkiRhwns7jEw/PUyLKxdU48NzUP6Ar59FQupb+pI=; b=KQYXJw8QbH3QhomG2K+F4TO0wjS/CgOBdsgWfnXnyReeOv/kx185VA9u1p/Qv34YLw RJwxfrjBqVJU4mTmU3TwSkFRjCSxZ0UkASqL/1wrcLq9WidNlbXv798F175+nsP3u59O Z5/WOtguJpadqZxbTjcZbpbdfmbTn09UTNGLfko9mt09UrzyfWD+kqfd52cmv7GexyzG X2P5pFWZtRjATttpe6r07vQdCYE0neCir++V9tpTw2issUr8HmIqOOPy5cujU8ay9uPr DWKQULFlsj5Pm1CjnTyQJKVKDJIK7YwEIcthluH/xRxyDAlxNU/Cbk9UcVKLHsaLxh9u nbuA== X-Gm-Message-State: AOAM531/jyzaMRQhlwJ77r80okPRHG9zP1KK3W3fSdSU/U4Jg9b2DoHL f09avpe3a+WbzX31uc+s7cA= X-Google-Smtp-Source: ABdhPJzRl2D9bOT6fHlkutrDf8r2pIb3UDvzundnQMNLu9g30wKgrUFpGFy3Bjji1CRFxe/y8DGQaw== X-Received: by 2002:a17:90b:33c6:b0:1dc:ba92:41bb with SMTP id lk6-20020a17090b33c600b001dcba9241bbmr10345429pjb.26.1652543733700; Sat, 14 May 2022 08:55:33 -0700 (PDT) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c90:c48:babf:bfaa:d815]) by smtp.gmail.com with ESMTPSA id n11-20020a170902e54b00b0015e8d4eb21asm3880437plf.100.2022.05.14.08.55.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 May 2022 08:55:32 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3696.80.82.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=casouri@gmail.com; helo=mail-pl1-x636.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, T_SCC_BODY_TEXT_LINE=-0.01 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:289779 Archived-At: > On May 14, 2022, at 8:09 AM, Daniel Mart=C3=ADn = wrote: >=20 > Yuan Fu writes: >=20 >> Guys, >>=20 >> I=E2=80=99ve pushed the tree-sitter integration to = feature/tree-sitter. If anyone want to give it a try: >> - get tree-sitter from GitHub (or your package manager, make sure the = version is at least 0.20.2) >> https://github.com/tree-sitter/tree-sitter >> - pull and build the branch >> - read (elisp)Parsing Program Source >> - grab language definitions from = https://github.com/casouri/tree-sitter-module >> You can either build with my script, or download the prebuilt ones >> - play with it >>=20 >> Also apologize in advance for that my response might be slow until = like June :-) >>=20 >> Yuan >=20 > Thanks for working on this. What is the best way to report > problems/contribute patches? =20 Thanks, you can just send a patch to me or open a report on debbugs and = send a patch there. > I've tried to build the branch and got a > "file not found" error when including (I have > tree-sitter correctly installed via Homebrew on macOS). I've fixed = the > problem with the following patch: >=20 > diff --git a/configure.ac b/configure.ac > index bf97dd017c..5a82d47db3 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -3115,7 +3115,6 @@ AC_DEFUN > [HAVE_TREE_SITTER=3Dyes], [HAVE_TREE_SITTER=3Dno]) > if test "${HAVE_TREE_SITTER}" =3D yes; then > AC_DEFINE(HAVE_TREE_SITTER, 1, [Define if using tree-sitter.]) > - TREE_SITTER_LIBS=3D-ltree-sitter > TREE_SITTER_OBJ=3D"treesit.o" > fi > fi Could you explain a bit why removing this line works for you? And what = specific problem are you solving? I=E2=80=99m not so savvy in autotools. > diff --git a/src/Makefile.in b/src/Makefile.in > index a21af42c0b..7533f25963 100644 > --- a/src/Makefile.in > +++ b/src/Makefile.in > @@ -344,7 +344,7 @@ JSON_CFLAGS =3D > JSON_OBJ =3D @JSON_OBJ@ >=20 > TREE_SITTER_LIBS =3D @TREE_SITTER_LIBS@ > -TREE_SITTER_FLAGS =3D @TREE_SITTER_FLAGS@ > +TREE_SITTER_CFLAGS =3D @TREE_SITTER_CFLAGS@ > TREE_SITTER_OBJ =3D @TREE_SITTER_OBJ@ > INTERVALS_H =3D dispextern.h intervals.h composite.h That=E2=80=99s indeed a typo, thanks. Yuan=