[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.
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, (continued)
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Dmitry Gutov, 2024/12/08
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Andrea Corallo, 2024/12/11
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Dmitry Gutov, 2024/12/11
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Yuan Fu, 2024/12/12
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Eli Zaretskii, 2024/12/12
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Yuan Fu, 2024/12/13
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms,
Eli Zaretskii <=
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Eli Zaretskii, 2024/12/12