[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: |
Yuan Fu |
Subject: |
Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms |
Date: |
Wed, 4 Dec 2024 10:21:13 -0800 |
> On Dec 3, 2024, at 12:30 AM, Andrea Corallo <acorallo@gnu.org> wrote:
>
> Yuan Fu <casouri@gmail.com> writes:
>
>> Some of my recent changes to c-ts-mode.el uses some more C treesit
>> functions, and I (again) forgot to add their declare-function forms to
>> c-ts-mode.el, and Andrea has to fix it for me. The main problem for me
>> is that (I think) you don’t get warning for them unless you build a
>> non-tree-sitter build of Emacs. So I’m prone to forgot about
>> them. Also it’s a burden for anyone wanting to use tree-sitter
>> functions.
>>
>> treesit.el already has all the declare-function forms, how about we
>> use (eval-when-compile 'treesit) in other files? I believe that should
>> alleviate us from adding those declare-function forms in other files?
>>
>> I want to ask because IIRC I proposed this a while back but there were
>> objections, the details of which I forgot.
>>
>> Yuan
>
> Hi Yuan,
>
> I was not part of the discussion and I don't know what's the downside of
> (eval-when-compile 'treesit), maybe another alternative would be to have
> like a dedicated treesit-delcs.el to require where necessary?
>
That’ll be ok too. Though 99.99% the case, if some package uses tree-sitter,
they’d need something in treesit.el too.
Yuan
- Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Yuan Fu, 2024/12/03
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Andrea Corallo, 2024/12/03
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms,
Yuan Fu <=
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Eli Zaretskii, 2024/12/03
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Yuan Fu, 2024/12/04
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Eli Zaretskii, 2024/12/04
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Yuan Fu, 2024/12/05
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Eli Zaretskii, 2024/12/05
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Yuan Fu, 2024/12/06
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Eli Zaretskii, 2024/12/07
- Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms, Stefan Monnier, 2024/12/07
- 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, Eli Zaretskii, 2024/12/08