From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#69290: declare-function doesn't work when combined with --eval and -batch Date: Tue, 20 Feb 2024 23:13:27 +0300 Message-ID: <7c6965eaa2f67eaba8128228033dc0b0d0efb42b.camel@yandex.ru> References: <868r3eoqw0.fsf@gnu.org> <2f376e6d58b58f3fa8afa5376018a37b1ba3fab4.camel@yandex.ru> <867ciyoqc4.fsf@gnu.org> 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="5938"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.50.3 Cc: 69290@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 20 21:15:17 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rcWWJ-0001KH-BI for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Feb 2024 21:15:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcWVt-00016B-LE; Tue, 20 Feb 2024 15:14:49 -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 1rcWVk-00015L-Ua for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2024 15:14:41 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rcWVk-0006mA-DK for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2024 15:14:40 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rcWW5-0003Si-Jz for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2024 15:15:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Feb 2024 20:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69290 X-GNU-PR-Package: emacs Original-Received: via spool by 69290-submit@debbugs.gnu.org id=B69290.170846004413227 (code B ref 69290); Tue, 20 Feb 2024 20:15:01 +0000 Original-Received: (at 69290) by debbugs.gnu.org; 20 Feb 2024 20:14:04 +0000 Original-Received: from localhost ([127.0.0.1]:46744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcWV6-0003Qo-Nz for submit@debbugs.gnu.org; Tue, 20 Feb 2024 15:14:04 -0500 Original-Received: from forward502b.mail.yandex.net ([178.154.239.146]:39422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcWV0-0003Qa-5H for 69290@debbugs.gnu.org; Tue, 20 Feb 2024 15:13:58 -0500 Original-Received: from mail-nwsmtp-smtp-production-main-46.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-46.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:3285:0:640:fd1e:0]) by forward502b.mail.yandex.net (Yandex) with ESMTPS id F1A8B5EF79; Tue, 20 Feb 2024 23:13:28 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-46.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id RDYL5cv7XCg0-SpKXcfwn; Tue, 20 Feb 2024 23:13:28 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1708460008; bh=ep7xF9TQugAFw0VGDzQVpK/MD1WnUksR4BfzqgnUnUk=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=wq3nCuCc4cXSi10XnE7y1Q6vYyr7LYeHuFfD9LVq5ssRFcOlSB5GhU3cRYQpE28h3 DE1G7YRUya0T98QvQyuG2g7wTphEkPYEXAJyi1IhDTSr8VLtyElharILmiGRCcFBH/ DsLhutbMV8Ybx3Hb0YrZRQDU6dPNard7dewzx1cs= Authentication-Results: mail-nwsmtp-smtp-production-main-46.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru In-Reply-To: <867ciyoqc4.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280356 Archived-At: On Tue, 2024-02-20 at 22:03 +0200, Eli Zaretskii wrote: > > From: Konstantin Kharlamov > > Cc: 69290@debbugs.gnu.org > > Date: Tue, 20 Feb 2024 22:56:01 +0300 > >=20 > > On Tue, 2024-02-20 at 21:51 +0200, Eli Zaretskii wrote: > > > > =C2=A0=C2=A0=C2=A0 =CE=BB emacs -batch --eval '(declare-function he= llo nil)' -f > > > > batch- > > > > byte-compile test.el > > > >=20 > > > > =C2=A0=C2=A0=C2=A0 In end of data: > > > > =C2=A0=C2=A0=C2=A0 test.el:2:2: Warning: the function =E2=80=98hell= o=E2=80=99 is not known to > > > > be > > > > defined. > > > >=20 > > > > ## Expected > > > >=20 > > > > There's no warning > > >=20 > > > What does the doc string of declare-function tell you about its > > > usage > > > and effect? > >=20 > > It says `Tell the byte-compiler that function FN is defined, in > > FILE`, > > and then FILE may be nil. In the context of the problem it seems > > the > > only thing that's relevant. There's a lot more text, but the rest > > of it > > just explains behavior of different parameters. Is there anything > > I'm > > missing? >=20 > Does --eval '(declare-function hello nil)' tell anything to the > byte-compiler? Well, I can guess by the way you're asking that the answer is "no", but I have no idea why so. It should. It is the same as if you pop up Emacs, evaluate a (defun hello()) and then call `byte-compile-file` over the `test.el`. There won't be a warning, despite that `(defun hello ())` was never byte-compiled (AFAIK Emacs does note byte-compile evaluated code).