From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew Date: Sat, 27 Jul 2024 22:50:35 +0200 Message-ID: <87v80qftk4.fsf@gnu.org> References: <874j8bx5gr.fsf@gnu.org> <875xsrjoi9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29587"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72313@debbugs.gnu.org, monnier@iro.umontreal.ca To: Arash Esbati Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 27 22:50:59 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 1sXoNW-0007ZI-Pb for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Jul 2024 22:50:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXoNS-0001rH-7C; Sat, 27 Jul 2024 16:50:54 -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 1sXoNQ-0001qk-7J for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 16:50:52 -0400 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 1sXoNP-0005Qa-TJ for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 16:50:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=R5EhN0VFXW+5xSFUx42UI3f6tHr0OoEz93IJqUi/+AE=; b=TpV5UxQla1OcBwPj56OFTFQVkcmxWKOPtkJ4wY45qrFCS1qU63+m3dm7xHTNqFPqLWk/n3njFXqbj6K6DhNUz6Fl5G7uhIPJdV/S6kL7hprr8O+TdvjbOmGkk3sxNVzdRcM9GBHpB8d0IajQROrdFB4C2nqtf+StWngwXb3zndgj/D57+RVWdKF3MMS6vSPf4PC96R1re64RlYm6oSqIhQ+Srydv7/rPVktaT63QrrsI/HWvfXDHNawUye2/fjcaxR/+W92RNvawNykwX3v8IzNJp4uqN2ozsXGDnMcGVvQwV1yAwoWyeA9uyMJcGAZ2jjXeHxUfO2XpSl3m8jIClg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sXoNa-0007Ri-9O for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 16:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Jul 2024 20:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72313 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: "Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors" , Stefan Monnier , 72313@debbugs.gnu.org Original-Received: via spool by 72313-submit@debbugs.gnu.org id=B72313.172211345728602 (code B ref 72313); Sat, 27 Jul 2024 20:51:02 +0000 Original-Received: (at 72313) by debbugs.gnu.org; 27 Jul 2024 20:50:57 +0000 Original-Received: from localhost ([127.0.0.1]:42480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXoNV-0007RF-AH for submit@debbugs.gnu.org; Sat, 27 Jul 2024 16:50:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXoNU-0007Qq-02 for 72313@debbugs.gnu.org; Sat, 27 Jul 2024 16:50:56 -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 1sXoND-0005Cq-HR; Sat, 27 Jul 2024 16:50:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=R5EhN0VFXW+5xSFUx42UI3f6tHr0OoEz93IJqUi/+AE=; b=PY4wuSfge3+CSsrCeFWm ZzFg+GkaxQN2aQ7Me+k1XQPiBmZD8RWJJ+gdNVQc4OmD6+7IjbVV6E5RLZFlAlxqilCIDvXTfGJQV qUlmPPCJ8wAygnvPT3AVlawWTflP0bDsurUzTJcf9sshoA2NVGg0YFIFbOjvXXLLdAd2u9uWZmVLX 4ULD2DAigIgYipPEC/UijWDVREoGeTB5uDB4KTWoP1PybuA0k/y4z7Jg7myVcN2fk0yhxzSaqb9vK wBXTMa8LbbB7mUkYBkE8H9YoPCxa4fdK3cN0CRljn+B9L+nqRP+xY2Cp8R2g8xEr9oUtve7AvzY0C yeBpLFv4XXFmUA==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrieejgdduheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffffkgggtsehttdertddttddtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepte eltdegheffhfetkeekveekkeevgfegkeetueffleeiheekhffgffeuueegieffnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmhdpnhgspghrtghpth htoheptd X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail In-Reply-To: (Arash Esbati's message of "Sat, 27 Jul 2024 17:29:43 +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:289446 Archived-At: Arash Esbati writes: > Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" writes: > >>> So the conclusion is to simply (require 'cl-lib) instead of >>> (eval-when-compile (require 'cl-lib))? But how can the >>> byte-compiler conclude that cl-member might not be defined at >>> runtime given that it's an autoloaded function? >> >> It's autoloaded from `cl-seq` when `cl-lib` is loaded. >> It's not autoloaded at startup. What's that magic? emacs -Q (featurep 'cl-lib) ;=> nil (describe-function 'cl-member) ; prints the help string to *Messages* (featurep 'cl-lib) ;=> t Do the help facilities load stuff on demand? > How about this approach then? > > --8<---------------cut here---------------start------------->8--- > diff --git a/tex-info.el b/tex-info.el > index dc69762e..0f77e057 100644 > --- a/tex-info.el > +++ b/tex-info.el > @@ -25,7 +25,8 @@ > ;;; Code: > > (eval-when-compile > - (require 'cl-lib)) > + (require 'cl-lib) > + (declare-function cl-member "cl-seq")) > > (require 'tex) > --8<---------------cut here---------------end--------------->8--- Let's just require cl-lib. declare-function only silences the byte-compiler and the usage of cl-member at runtime is a fact; no cheating allowed. It's also an implementation detail we should not bother with. Tomorrow, Stefan might have optimized it to use some cl-memql-1-wazzup for the specific case we have here. :-) Bye, Tassilo