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