From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms Date: Thu, 12 Dec 2024 08:19:53 +0200 Message-ID: <86jzc51kza.fsf@gnu.org> References: <2C0B7D3A-6131-4427-BF04-9211981B57DD@gmail.com> <867c8g3o6v.fsf@gnu.org> <0D278D91-4D67-4E0E-869F-6AF0A46678F7@gmail.com> <791c31a1-84ab-4cab-921b-cc8977e980d9@gutov.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39696"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acorallo@gnu.org, casouri@gmail.com, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 12 07:20:53 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tLcZA-000A8I-9J for ged-emacs-devel@m.gmane-mx.org; Thu, 12 Dec 2024 07:20:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLcYI-00022Z-Fr; Thu, 12 Dec 2024 01:19:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLcYH-00022N-Mi for emacs-devel@gnu.org; Thu, 12 Dec 2024 01:19:57 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLcYH-0007If-C2; Thu, 12 Dec 2024 01:19:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=t0Pkr1hPk/ceBkM8KJfcbvRviJrK3Rxxh5KU8u1pNIw=; b=l6FE9MdSs5NP Fie5FewwC39N8ZBDvbIb3/srX9h/ukB1ZN6/76rByhy2dc2UMPsYerHmXzi9picEdUcnrHFknH/RY BWBnoga4FjM9LVQ1SG28tigN4c4zfMpXVphDBqOJoUN1cC4FL6PxaWYGG38sOCvJ3smH2M/dr6XMe ZDwZAIpOH4rSC9kQg5ewC0fcebiPNC/5uzWk/Abo4gMZUpmNbau47o8IxGiy0gKp3qClqoFptknt2 uYXc0r4UedHyCdC5gQumrXuMk3p27rtteTO2D3iHOjk5kcTw+gThL3nXl1JhqG0uP23DtU+zhGgTk ieR5RalSSkZINzqUkradhg==; In-Reply-To: (message from Dmitry Gutov on Thu, 12 Dec 2024 02:23:02 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326404 Archived-At: > Date: Thu, 12 Dec 2024 02:23:02 +0200 > Cc: Yuan Fu , Eli Zaretskii , > emacs-devel@gnu.org > From: Dmitry Gutov > > 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.