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: Would (Eval-when-compile (require 'treesit)) eliminate the need for (declare-function)s? Date: Mon, 17 Apr 2023 20:05:37 +0300 Message-ID: <83fs8ya17i.fsf@gnu.org> References: <6E9242F5-EC30-4BA5-A290-0AA6CCB7ECE7@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33415"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yuan Fu , Lars Ingebrigtsen , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 17 19:05:53 2023 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 1poSIb-0008TY-6S for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Apr 2023 19:05:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poSIH-0005b2-AX; Mon, 17 Apr 2023 13:05:33 -0400 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 1poSIE-0005ae-W6 for emacs-devel@gnu.org; Mon, 17 Apr 2023 13:05:31 -0400 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 1poSIE-0005fn-ML; Mon, 17 Apr 2023 13:05:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=C/R0axp6zFzMBJLGSl+dJ3lsQsQp0pUXwHGMv5+o/nA=; b=rYVM8G3mULebccVik1lz KV2uw/85P5azs3FMaHpbPM+fCXiJtQGN18WLk5V3gqnSWWb7cz+NhwCZQJOZ0bCSOIsVvQiLx4zLY Y/FUcqHwm54Y9TpzjJQf4yIpwytWPXeF0QzmoP1DaPhgkai8/PY8aCWjI9KKUwrUYzC3PMITUU2rO zJ6qdfxyTwfdCZIU5APFoDRU0LiE/lHPq1BmzbblL3zhmn+Q/WR/vjLRcH//pNZ8LpoUbOGydkOS9 2RdesL4Lfi7z5XCK+6YtLBgcBHqjZs32iv3wMhkYu7+kqxb5sZyNAFMvmxy3qElwsdNyy+ahlvpbV JHVCSXJl2deHng==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poSIE-0001lG-6c; Mon, 17 Apr 2023 13:05:30 -0400 In-Reply-To: <6E9242F5-EC30-4BA5-A290-0AA6CCB7ECE7@gmail.com> (message from Yuan Fu on Sun, 16 Apr 2023 20:12:22 -0700) 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:305376 Archived-At: > From: Yuan Fu > Date: Sun, 16 Apr 2023 20:12:22 -0700 > > I’ve made the mistake of forgetting to add (declare-function treesit-xxx) when using functions from treesit.c far too many times (sorry!). Since treesit.el contains declare-function’s for every function in treesit.c, if we use (eval-when-compile (require ’treesit)), would it eliminate the need for adding declare-function’s? Should we do that? Even if it does work reliably, I'm not sure we want that. It is better to have declare-function where the function is used, as that makes maintenance easier and less error-prone. Lars, Stefan: WDYT?