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.bugs Subject: bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body Date: Wed, 14 Feb 2024 18:38:01 +0200 Message-ID: <867cj7xaqe.fsf@gnu.org> References: <7f4f61be9fbdb5d07b9420d9b75a7ed9d1522744.camel@yandex.ru> <86eddfxe7d.fsf@gnu.org> <7aa4ac2b4eb557533d5b77b03b3ce2a74a674f21.camel@yandex.ru> <868r3nxc4u.fsf@gnu.org> <379435a543c0fb73d4f0ede0fd8c82b4134ec41d.camel@yandex.ru> 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="9475"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69120@debbugs.gnu.org To: Konstantin Kharlamov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 14 17:38:58 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 1raIHh-0002CK-5F for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Feb 2024 17:38:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raIHY-0001r2-5L; Wed, 14 Feb 2024 11:38:48 -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 1raIHU-0001qd-6L for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2024 11:38:44 -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 1raIHT-00033Q-Ux for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2024 11:38:43 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1raIHl-00050o-SR for bug-gnu-emacs@gnu.org; Wed, 14 Feb 2024 11:39:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Feb 2024 16:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69120 X-GNU-PR-Package: emacs Original-Received: via spool by 69120-submit@debbugs.gnu.org id=B69120.170792871619235 (code B ref 69120); Wed, 14 Feb 2024 16:39:01 +0000 Original-Received: (at 69120) by debbugs.gnu.org; 14 Feb 2024 16:38:36 +0000 Original-Received: from localhost ([127.0.0.1]:52913 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raIHM-000508-9T for submit@debbugs.gnu.org; Wed, 14 Feb 2024 11:38:36 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raIHK-0004zw-I1 for 69120@debbugs.gnu.org; Wed, 14 Feb 2024 11:38:35 -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 1raIGw-0002wx-GP; Wed, 14 Feb 2024 11:38:10 -0500 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=pO7IdemnYap7zQfRJjv6shEmyzL8U4xSTxwJC7i115s=; b=OpyNQxLIlv/IQmWuENWT /lxqt/36ea4jAK6xZI/8d4e8LQRXQLPe6PpTSrAUBN/fxiEZqDAFRz0bj+copfLqBmDo9SNg8ie59 qbhrOrsL+GKN2E8KQw9RpxEwTR6Amg+xaGj7vyMWcd1nDWs48qc7XJi8U3qXjQvqfqvawQUG7fMUr E/8KTeLpT4IwoHuSTDCS0kMVhlFahApOZZViqTGkJa/XlFYt93cB7qPU/AH1IAB0YTkQG8DTFqCUt oP2u36fbb7xMj80DPRb0u6RksFFExTIZvUwndQDfMQ4NdCGU+AK3h9lU84UzBMoRn6ZKXgy6LUZXd D3xeH+yt0jWAXg==; In-Reply-To: <379435a543c0fb73d4f0ede0fd8c82b4134ec41d.camel@yandex.ru> (message from Konstantin Kharlamov on Wed, 14 Feb 2024 19:10:54 +0300) 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:280017 Archived-At: > From: Konstantin Kharlamov > Cc: 69120@debbugs.gnu.org > Date: Wed, 14 Feb 2024 19:10:54 +0300 > > On Wed, 2024-02-14 at 18:07 +0200, Eli Zaretskii wrote: > > > From: Konstantin Kharlamov > > > Cc: 69120@debbugs.gnu.org > > > Date: Wed, 14 Feb 2024 18:28:15 +0300 > > > > > > > >     test.el:6:4: Warning: the function ‘hello’ is not known to > > > > > be > > > > > defined. > > > > > > > > What do you get if you macro-expand your code? > > > > > > Wrapping the above code to a `(macroexpand …)` gives a: > > > > > >    "hello" > > >    nil > > > > You need to quote the form you pass to macroexpand, to get the > > expansion, I think. > > Oh indeed you're right! > > It gives me the following: > > (progn (defvar use-package--warning196 #'(lambda (keyword err) (let ((msg (format "%s/%s: %s" 'prog-mode keyword (error-message-string err)))) (display-warning 'use-package msg :error)))) (condition-case-unless-debug err (progn (condition-case-unless-debug err (progn (defun hello nil (print "hello")) (hello)) (error (funcall use-package--warning196 :init err))) (if (not (require 'prog-mode nil t)) (display-warning 'use-package (format "Cannot load %s" 'prog-mode) :error))) (error (funcall use-package--warning196 :catch err)))) And that doesn't explain the warning?