emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tree-sitter integration on feature/tree-sitter


From: Yuan Fu
Subject: Re: Tree-sitter integration on feature/tree-sitter
Date: Sat, 14 May 2022 08:55:31 -0700


> On May 14, 2022, at 8:09 AM, Daniel Martín <mardani29@yahoo.es> wrote:
> 
> Yuan Fu <casouri@gmail.com> writes:
> 
>> Guys,
>> 
>> I’ve 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
>> 
>> Also apologize in advance for that my response might be slow until like June 
>> :-)
>> 
>> Yuan
> 
> Thanks for working on this.  What is the best way to report
> problems/contribute patches?  

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 <tree_sitter/api.h> (I have
> tree-sitter correctly installed via Homebrew on macOS).  I've fixed the
> problem with the following patch:
> 
> 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=yes], [HAVE_TREE_SITTER=no])
>   if test "${HAVE_TREE_SITTER}" = yes; then
>     AC_DEFINE(HAVE_TREE_SITTER, 1, [Define if using tree-sitter.])
> -    TREE_SITTER_LIBS=-ltree-sitter
>     TREE_SITTER_OBJ="treesit.o"
>   fi
> fi

Could you explain a bit why removing this line works for you? And what specific 
problem are you solving? I’m 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 =
> JSON_OBJ = @JSON_OBJ@
> 
> TREE_SITTER_LIBS = @TREE_SITTER_LIBS@
> -TREE_SITTER_FLAGS = @TREE_SITTER_FLAGS@
> +TREE_SITTER_CFLAGS = @TREE_SITTER_CFLAGS@
> TREE_SITTER_OBJ = @TREE_SITTER_OBJ@
> INTERVALS_H = dispextern.h intervals.h composite.h

That’s indeed a typo, thanks.

Yuan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]