From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Use (eval-when-compile 'treesit) to save us from writing declare-function forms Date: Sun, 08 Dec 2024 21:40:29 -0500 Message-ID: References: <2C0B7D3A-6131-4427-BF04-9211981B57DD@gmail.com> <867c8g3o6v.fsf@gnu.org> <0D278D91-4D67-4E0E-869F-6AF0A46678F7@gmail.com> <86h67jz36z.fsf@gnu.org> <502D58B8-9432-4A8F-B50D-ECA392B7E7C5@gmail.com> <86ser2y5e1.fsf@gnu.org> <86ser0j5hw.fsf@gnu.org> <292D0D0F-AB88-49AB-86DD-A9B736DB00F7@gmail.com> <1771C735-A03F-4FE5-8FCE-22F9647F4C36@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="24175"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 09 03:41:26 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 1tKTi9-00068m-Ur for ged-emacs-devel@m.gmane-mx.org; Mon, 09 Dec 2024 03:41:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKThP-0007sO-Eq; Sun, 08 Dec 2024 21:40: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 1tKThN-0007s4-0n for emacs-devel@gnu.org; Sun, 08 Dec 2024 21:40:37 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKThL-00075V-4H; Sun, 08 Dec 2024 21:40:36 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7D0FA442C77; Sun, 8 Dec 2024 21:40:32 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1733712031; bh=CY8vG2qv0tYiHddgCb1U67M3rXAwmYn7eBGgLY8XG1c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ewc4OFSyAYQcfbhlhOX9eOWUAcxFurIFE3bIH+tP6cKiqw39VgOT2Ro8XqYr1Qc4T 6CpenQPcwdqMUrWsgsE2RTE+8/ujtpKS8mJdNZXdkN2sBDP4l89WCb3t+3fqgcH7mu RpG3l+CjoYbUWgEDHuFjZg/EDlSE65WXx0h2Ot9flcuGEGM1QRQS+0hHZZyZkEQWL9 wLpVMsv1yCvmxhgR5rlpUFEOIDMdCzc4r2gQULTuM+LJDs0F9lvsc4swuwB53XpJSk yFrYsdvm4d9S9fmXc7tlAerGyrehl3gzyKEQ8jSoOJLavXkzyqOIDzFaE9NId7gQZG 2M33cg7iASrAg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 84A02442C54; Sun, 8 Dec 2024 21:40:31 -0500 (EST) Original-Received: from asado (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 50A4212064E; Sun, 8 Dec 2024 21:40:31 -0500 (EST) In-Reply-To: <1771C735-A03F-4FE5-8FCE-22F9647F4C36@gmail.com> (Yuan Fu's message of "Sun, 8 Dec 2024 17:37:59 -0800") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:326225 Archived-At: > I thought eval-when-compile is more of a =E2=80=9Cinclude if compiling=E2= =80=9D macro, should=E2=80=99ve checked :) > > We can also go with Dmitry=E2=80=99s idea, and just define all the functi= ons in > treesit.el if Emacs is not built with tree-sitter. We can detect that with > treesit-available-p. I haven't really thought about it, so I don't have a strong opinion. AFAICT your proposal should work fine even if you remove the `eval-when-compile` wrappers to which I objected. =F0=9F=99=82 Stefan