From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69120: Spurious "function is not known to be defined" if defined in `use-package` body Date: Thu, 15 Feb 2024 10:21:03 -0500 Message-ID: References: <7f4f61be9fbdb5d07b9420d9b75a7ed9d1522744.camel@yandex.ru> <86eddfxe7d.fsf@gnu.org> <7aa4ac2b4eb557533d5b77b03b3ce2a74a674f21.camel@yandex.ru> <868r3nxc4u.fsf@gnu.org> <379435a543c0fb73d4f0ede0fd8c82b4134ec41d.camel@yandex.ru> <867cj7xaqe.fsf@gnu.org> <66ec2134f5cde69d417646dba07ec724f15af36d.camel@yandex.ru> <5d0c0baa89e8fc0fe6fe9d4fdfbca72cf67d123e.camel@yandex.ru> <4380470ad6bbde9eb8b72135a039da5d218df8e9.camel@yandex.ru> <86v86qw77z.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30228"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 69120@debbugs.gnu.org, Konstantin Kharlamov To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 15 16:22:08 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 1radYu-0007ex-CL for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Feb 2024 16:22:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1radYX-0008M2-Af; Thu, 15 Feb 2024 10:21:45 -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 1radYW-0008Lt-Fm for bug-gnu-emacs@gnu.org; Thu, 15 Feb 2024 10:21: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 1radYW-0006iM-7S for bug-gnu-emacs@gnu.org; Thu, 15 Feb 2024 10:21:44 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1radYo-0000zs-GY for bug-gnu-emacs@gnu.org; Thu, 15 Feb 2024 10:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Feb 2024 15:22:02 +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.17080104973798 (code B ref 69120); Thu, 15 Feb 2024 15:22:02 +0000 Original-Received: (at 69120) by debbugs.gnu.org; 15 Feb 2024 15:21:37 +0000 Original-Received: from localhost ([127.0.0.1]:56756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1radYP-0000zC-1R for submit@debbugs.gnu.org; Thu, 15 Feb 2024 10:21:37 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1radYM-0000yy-MD for 69120@debbugs.gnu.org; Thu, 15 Feb 2024 10:21:35 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2EF4E1000C3; Thu, 15 Feb 2024 10:21:10 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1708010469; bh=PptfenAEVaDpzx4VFG1/IUrxGTdsP61TNByvqPMxHPE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ff718NYgA0XNwYRQgg6Nu3ZX3kyjeaP3VH2iczCLg+p0PvQiocpxU1H55UL6ncixt ms1V8H/MgDAoepmcGcT/LJ5UQaycVyK5Zb3bCx/90G4cocPfOWY5TyGiqSX7vCVtPE qUYt6gEPCUKNTbODi4huQJYLFCK4RchAG0eWJg5gNhqkn+NxlSSnHGYncS7WYgQG2B IARFqr3qNH0kkZkFL81oALVaTO8fQzAHLwfNquTP51ExnY1AJGoBrFvsDBLrXobcrm 6+wTgOtiHLmavW4zWeVJzoGoqObH9AwMpdqODOJNPEQxqv8XHmYgUoxELH6kHKC5ND Tb62clWzABf6Q== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4B29310004B; Thu, 15 Feb 2024 10:21:09 -0500 (EST) Original-Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2FCE61203F3; Thu, 15 Feb 2024 10:21:09 -0500 (EST) In-Reply-To: <86v86qw77z.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 15 Feb 2024 08:51:28 +0200") 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:280060 Archived-At: >> > =A0=A0 ;;; -*- lexical-binding: t -*- >> > =A0=A0 (defun foo () >> > =A0=A0=A0=A0 (defun hello() >> > =A0=A0=A0=A0=A0=A0 (print "hello")) >> > =A0=A0=A0=A0 (hello)) >>=20 >> An interesting fact: inserting a `(declare-function hello nil)` after a >> `defun` suppresses the warning. So I guess `defun` should work somehow >> similarly to `declare-function`. > > Perhaps Stefan (CC'ed) will have some comments or advice. Both `defun` and `declare-function` work in unsatisfactory ways in this respect. Any `declare-function` anywhere in the file will silence all warnings about this function in the whole file, which is too lax. `defun` in contrast only silences the warnings if it's at the top-level, which is too restrictive. We should make them both work a bit more like `defvar`. Stefan