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:19:53 +0200

> Date: Thu, 12 Dec 2024 02:23:02 +0200
> Cc: Yuan Fu <casouri@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
>  emacs-devel@gnu.org
> From: Dmitry Gutov <dmitry@gutov.dev>
> 
> On 12/12/2024 01:38, Andrea Corallo wrote:
> > 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
> 
> We also don't typically require a caller to have a 'declare-function' 
> for every function they use from a package that they (require ...) already.

This is not the case here, since declare-function are needed for
functions defined in treesit.c, not in treesit.el.

> > - 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.
> 
> Sure. All non-static ones anyway.

Only those defined with DEFUN.  The rest are not visible from Lisp,
whether static or not.



reply via email to

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