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#69120: Spurious "function is not known to be defined" if defined in `use-package` body Date: Wed, 14 Feb 2024 14:16:09 +0300 Message-ID: <7f4f61be9fbdb5d07b9420d9b75a7ed9d1522744.camel@yandex.ru> 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="21357"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.50.3 To: 69120@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 14 12:23:34 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 1raDMU-0005ND-86 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Feb 2024 12:23:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raDG9-0006qk-IB; Wed, 14 Feb 2024 06:17:01 -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 1raDFu-0006Sv-9G for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2024 06:16:48 -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 1raDFs-0007aS-K5 for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2024 06:16:45 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1raDGA-00079H-Ab for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2024 06:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Feb 2024 11:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69120 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.170790940127436 (code B ref -1); Wed, 14 Feb 2024 11:17:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Feb 2024 11:16:41 +0000 Original-Received: from localhost ([127.0.0.1]:50590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raDFp-00078S-C2 for submit@debbugs.gnu.org; Wed, 14 Feb 2024 06:16:41 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:43378) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raDFm-00078J-Gh for submit@debbugs.gnu.org; Wed, 14 Feb 2024 06:16: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 1raDFT-0005lS-By for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2024 06:16:19 -0500 Original-Received: from forward102c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:d102]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raDFP-0007Os-2R for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2024 06:16:18 -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 forward102c.mail.yandex.net (Yandex) with ESMTPS id C560760C5B for ; Wed, 14 Feb 2024 14:16:09 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-46.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 9GmBXX8BX8c0-MdkM5kXI; Wed, 14 Feb 2024 14:16:09 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1707909369; bh=On5TOpDpMW7Qa65n9Si+qmDumxSaJuR0pLcLgJRo13o=; h=Date:To:From:Subject:Message-ID; b=OMo3NYSeaUCtUziQy6PKs9ccLYhZItshMrP2YlAtLBP6U+T1buim4QdTDOB7ulhdi G6NX7Bw918lyjp3UxPq4dyoF73Q+MiPfk4qf0aXpyf7spz5/Sn7fuWMvCRISlE0tcH rIzvghYhmalqbiqmYb963tQbbFoGn/bXrEMfZd8Y= Authentication-Results: mail-nwsmtp-smtp-production-main-46.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received-SPF: pass client-ip=2a02:6b8:c03:500:1:45:d181:d102; envelope-from=Hi-Angel@yandex.ru; helo=forward102c.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:280001 Archived-At: I have many functions that are only useful inside a specific mode. So I group them with `use-package`, by defining them inside `:init` or `:config` section, depending on the use. It turns out, byte-compiler does not consider such functions to be defined and prints a warning about it. # Steps to reproduce (in terms of terminal commands) =CE=BB cat test.el ;;; -*- lexical-binding: t -*- (use-package prog-mode :init (defun hello() (print "hello")) (hello)) =CE=BB emacs -batch -f batch-byte-compile test.el In end of data: test.el:6:4: Warning: the function =E2=80=98hello=E2=80=99 is not known= to be defined. ## Expected File gets compiled with no warnings ## Actual There's a warning test.el:6:4: Warning: the function =E2=80=98hello=E2=80=99 is not known= to be defined. # Additional information Emacs version: commit d4d5830f8a0 built two weeks ago from master.