From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms Date: Tue, 03 Dec 2024 03:30:09 -0500 Message-ID: References: <2C0B7D3A-6131-4427-BF04-9211981B57DD@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18487"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Emacs Devel To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 03 09:30:59 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 1tIOJ9-0004d6-6Q for ged-emacs-devel@m.gmane-mx.org; Tue, 03 Dec 2024 09:30:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIOIp-0000w9-55; Tue, 03 Dec 2024 03:30:39 -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 1tIOIe-0000vU-0v for emacs-devel@gnu.org; Tue, 03 Dec 2024 03:30:29 -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 1tIOIc-0003hZ-KX; Tue, 03 Dec 2024 03:30:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=GP9fS/Cqp0IkKBlh97zq4cV+z+7+Kd2cq8dSjpzhMns=; b=a7hMy47A6tKbHZvVCWSD o4sOaUJddERNEQff5wjMg4e2UcDI7MfyEueGBka450xlCwHW4ttbvH5m87R2jgzSP2BWxOZMrAHm0 95rh5YTC7e/LKePHb6AK3rIc/ybDdPYLlRf8VCgz5bctH92J+Ro4i6NVaqyux9lkTbpqtoZjz4e18 dUgOojLWZSCf2iby9tWbfd8V/Ww8CzSk2bp63yVqy2Pl8VOsz+SyqNfJNBbDcu9S3JjIXsen2ybhS 21a1vRYGpRg4O5E3orgSyIFasYN28R0cryyJ3S+5zaqxQploMBAG6pIo8qaaj8AJ7O41T/xCfhZyt SqUbRHM0aea0GA==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1tIOIM-0007am-0c; Tue, 03 Dec 2024 03:30:25 -0500 In-Reply-To: <2C0B7D3A-6131-4427-BF04-9211981B57DD@gmail.com> (Yuan Fu's message of "Mon, 2 Dec 2024 22:31:48 -0800") 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:325977 Archived-At: Yuan Fu 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=E2=80=99t get warning for them unless you build= a > non-tree-sitter build of Emacs. So I=E2=80=99m prone to forgot about > them. Also it=E2=80=99s 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 ob= jections, 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? Andrea