emacs-devel
[Top][All Lists]
Advanced

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

Re: Use (eval-when-compile 'treesit) to save us from writing declare-fun


From: Eli Zaretskii
Subject: Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms
Date: Thu, 12 Dec 2024 08:13:04 +0200

> From: Andrea Corallo <acorallo@gnu.org>
> Cc: Yuan Fu <casouri@gmail.com>,  Eli Zaretskii <eliz@gnu.org>,
>   emacs-devel@gnu.org
> Date: Wed, 11 Dec 2024 18:38:32 -0500
> 
> Dmitry Gutov <dmitry@gutov.dev> writes:
> 
> > On 04/12/2024 20:19, Yuan Fu wrote:
> >> When Emacs is built without tree-sitter, none of the treesit.c functions 
> >> are available (except for treesit-ready-p)
> >
> > Have we considered having all of those functions defined but doing
> > nothing in that case? Alias them to 'ignore' or something that raises
> > an error.
> >
> > I think then we won't have to maintain these 'declare-function' lists
> > in every package that depends on treesit.c.
> 
> The suggestion of having the C functions defined to nops when
> HAVE_TREE_SITTER is not defined is cleaner in principle, but I think
> there are two downsides:
> 
> - We don't tipically do it this way, so it would be an exception
> 
> - Also we should do it for all the functions in treesit.c, otherwise we
>   don't solve the original problem of introducing warnings by mistake on
>   non treesit builds.

Yes, I agree.



reply via email to

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