From unknown Fri Aug 15 18:47:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72414: 29.4; use-package :defer keyword does not honor ":defer nil" Resent-From: Derek Upham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Aug 2024 23:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72414 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 72414@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172255507815080 (code B ref -1); Thu, 01 Aug 2024 23:32:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Aug 2024 23:31:18 +0000 Received: from localhost ([127.0.0.1]:52085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZfGP-0003v9-Vm for submit@debbugs.gnu.org; Thu, 01 Aug 2024 19:31:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:53860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZfGM-0003v0-5d for submit@debbugs.gnu.org; Thu, 01 Aug 2024 19:31:16 -0400 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 1sZfG3-0000ge-BW for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2024 19:30:56 -0400 Received: from wilbur.contactoffice.com ([212.3.242.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZfG0-0007Xb-LO for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2024 19:30:54 -0400 Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id DF73BB5C for ; Fri, 2 Aug 2024 01:30:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1722555046; s=20240605-akrp; d=mailfence.com; i=derek_upham@mailfence.com; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=D7IJEPiu18pjoZXaTfFFrugsQJKqV1SCByclsEWBOiE=; b=uFPrQ3eA5BNKZHoEQw+ITj2tDixXP6U9pR7w0pHQCUbs7bepMPGvo/W4x1sSaue6 qds3dmu+axQq5YtBrdb4hU5Xlxco9GbcGwqFgyv4UlFNw5AF5OQDX+W5X5emy1TyM2t ZIWjQbdT7bcNEF0CpzyyaCHiULZVI7YpDZJ53oQ/1Mjax4KakQFS5LGTPKbhTXPDwu6 RNQoQhwC2AMH9SfGJwYauJogg8/UFEcCLeKns6n1x9p0vi9tLNY8ppjJkUSUNZhk9g+ 2rkls6IMh6DV85Fw6lm0Io/iuNz+H3JklsTFBFeGF0LY/AfhMwCLr095BYNEBYHbqNp hwHJMqwUdw== Received: by smtp.mailfence.com with ESMTPSA for ; Fri, 2 Aug 2024 01:30:42 +0200 (CEST) Received: from [::1] (helo=priss.frightenedpiglet.com) by priss.frightenedpiglet.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97) (envelope-from ) id 1sZfFo-00000000WtL-35Pl for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2024 16:30:40 -0700 From: Derek Upham Date: Thu, 01 Aug 2024 16:30:40 -0700 Message-ID: <87r0b7akin.fsf@priss.frightenedpiglet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ContactOffice-Account: com:175140567 Received-SPF: pass client-ip=212.3.242.68; envelope-from=derek_upham@mailfence.com; helo=wilbur.contactoffice.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) - The relevant file is "lisp/use-package/use-package-core.el". - The function is "use-package-normalize-keywords". - This is as of commit 4c6e9f5b004, current for this file on the "emacs-30" tag. Near the bottom of the use-package-normalize-keywords function, we have the following code block. ;; If at this point no :load, :defer or :no-require has been seen, then ;; :load the package itself. (when (and (not (plist-member args :load)) (not (plist-member args :defer)) (not (plist-member args :no-require))) (setq args (append args `(:load (,name))))) The intent is that we add an immediate-load instruction to the keyword list, if there is no reason to not add it. We have a couple of possible reasons to not add it: 1. There's already a :load keyword. 2. We have asked use-package to :defer loading. 3. We have asked use-package to not require the package, to avoid certain byte-compilation problems. The Use-Package documentation section 3.2 goes into more detail about the :defer keyword behavior in (2). If you customize the user option =E2=80=98use-package-always-defer=E2=80= =99 to non-=E2=80=98nil=E2=80=99, the =E2=80=98use-package=E2=80=99 macro will = behave as if =E2=80=98:defer t=E2=80=99 is always specified. This can be overridden for individual declarations using either =E2=80=98:defer nil=E2=80=99 or =E2=80=98:demand t=E2=80=99= (*note Forcing loading::). The way the code above uses plist-member doesn't match the documentation. The test looks for the simple presence of a :defer key/value, and doesn't distinguish between any of the possible values: t, nil, or an integer. Replacing plist-member with plist-get should fix the problem. A ":defer nil" would produce the same nil value as a missing :defer. In GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0) of 2024-06-29, modified by Debian built on sbuild Windowing system distributor 'The X.Org Foundation', version 11.0.12101011 System Description: Debian GNU/Linux trixie/sid Configured using: 'configure --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/libexec --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --with-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/29.4/site-lisp:= /usr/local/share/emacs/site-lisp:/usr/share/emacs/29.4/site-lisp:/usr/share= /emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --with-native-compilation --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/libexec --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --with-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/29.4/site-lisp:= /usr/local/share/emacs/site-lisp:/usr/share/emacs/29.4/site-lisp:/usr/share= /emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --with-native-compilation --with-cairo --with-x=3Dyes --with-x-toolkit=3Dgtk3 --with-toolkit-scroll-bars 'CFLAGS=3D-g -O2 -Werror=3Dimplicit-function-declaration -ffile-prefix-map=3D/build/reproducible-path/emacs-29.4+1=3D. -fstack-prot= ector-strong -fstack-clash-protection -Wformat -Werror=3Dformat-security -fcf-protection -Wall' 'CPPFLAGS=3D-Wdate-time -D_FORTIFY_SOURCE=3D2' LDFLAGS=3D-Wl,-z,relro' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix --=20 Derek Upham derek_upham@mailfence.com From unknown Fri Aug 15 18:47:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72414: 29.4; use-package :defer keyword does not honor ":defer nil" Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Aug 2024 06:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72414 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Derek Upham , John Wiegley Cc: 72414@debbugs.gnu.org Received: via spool by 72414-submit@debbugs.gnu.org id=B72414.172257843120660 (code B ref 72414); Fri, 02 Aug 2024 06:01:02 +0000 Received: (at 72414) by debbugs.gnu.org; 2 Aug 2024 06:00:31 +0000 Received: from localhost ([127.0.0.1]:52199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZlL4-0005NA-PJ for submit@debbugs.gnu.org; Fri, 02 Aug 2024 02:00:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZlL1-0005Mx-S8 for 72414@debbugs.gnu.org; Fri, 02 Aug 2024 02:00:30 -0400 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 1sZlIW-0005jx-Gt; Fri, 02 Aug 2024 01:57:52 -0400 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=HFB/uNALKLMGNiOPrhDNxi+B+TW71C0nN8OObKnW5V4=; b=ETb8MpyMnzodkXkbUQJD PluuQ5GqJjcYFDyOVHIPvHFTt3l2cSMCiB0whXrqhcqjEv6svJB6efiP1OeB9CTeiuxmbeeLiDkDW aRv5C08wNoz63BKeVrvgPbhtEB0f/2sFjTYT7Qbt61mH6zpwgjCM0bJ42KSIQPXBbT1FMNnI/CC/f E6q81S73HZLJJEW8X6W9UiBCnb4im0OihnsYVef6p+JHQmnh23AhTZZ/dYWxIaP9HCsLoneXV+Hee jPqljMo93lte8CIA3Y/0GFRWee0AhDhRyPO1LLfKwN0tQrNXmNCKJZrL9rWkmpeoMAP72EGERiZC7 48YvdZ0IV0GtXg==; Date: Fri, 02 Aug 2024 08:57:46 +0300 Message-Id: <86bk2bwjol.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87r0b7akin.fsf@priss.frightenedpiglet.com> (bug-gnu-emacs@gnu.org) References: <87r0b7akin.fsf@priss.frightenedpiglet.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 01 Aug 2024 16:30:40 -0700 > From: Derek Upham via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > - The relevant file is "lisp/use-package/use-package-core.el". > - The function is "use-package-normalize-keywords". > - This is as of commit 4c6e9f5b004, current for this file on the > "emacs-30" tag. > > Near the bottom of the use-package-normalize-keywords function, we have > the following code block. > > ;; If at this point no :load, :defer or :no-require has been seen, then > ;; :load the package itself. > (when (and (not (plist-member args :load)) > (not (plist-member args :defer)) > (not (plist-member args :no-require))) > (setq args (append args `(:load (,name))))) > > The intent is that we add an immediate-load instruction to the keyword > list, if there is no reason to not add it. We have a couple of possible > reasons to not add it: > > 1. There's already a :load keyword. > 2. We have asked use-package to :defer loading. > 3. We have asked use-package to not require the package, to avoid > certain byte-compilation problems. > > The Use-Package documentation section 3.2 goes into more detail about > the :defer keyword behavior in (2). > > If you customize the user option ‘use-package-always-defer’ to > non-‘nil’, the ‘use-package’ macro will behave as if ‘:defer t’ is > always specified. This can be overridden for individual declarations > using either ‘:defer nil’ or ‘:demand t’ (*note Forcing loading::). > > The way the code above uses plist-member doesn't match the > documentation. The test looks for the simple presence of a :defer > key/value, and doesn't distinguish between any of the possible values: > t, nil, or an integer. > > Replacing plist-member with plist-get should fix the problem. A ":defer > nil" would produce the same nil value as a missing :defer. Thanks for the report and the analysis. John, any comments or suggestions about this? From unknown Fri Aug 15 18:47:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72414: 29.4; use-package :defer keyword does not honor ":defer nil" Resent-From: John Wiegley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Aug 2024 22:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72414 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 72414@debbugs.gnu.org, Derek Upham Received: via spool by 72414-submit@debbugs.gnu.org id=B72414.172263810527286 (code B ref 72414); Fri, 02 Aug 2024 22:36:02 +0000 Received: (at 72414) by debbugs.gnu.org; 2 Aug 2024 22:35:05 +0000 Received: from localhost ([127.0.0.1]:53854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sa0rZ-000762-9f for submit@debbugs.gnu.org; Fri, 02 Aug 2024 18:35:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sa0rV-00075Q-G5 for 72414@debbugs.gnu.org; Fri, 02 Aug 2024 18:35:04 -0400 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 1sa0oz-0003cC-TN; Fri, 02 Aug 2024 18:32:26 -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=ms5vlPlADJbcYWzwyDXCnNhld+Piph3To7xenDpyNis=; b=KpqNSh3LXSiabK93d8LM +Ng7ZTH0ZugsQq6nCa9y3g6VUhy2AC3/JtzLm2bsH7BQpL+PyokpcdVIlBULVE57F/OKM7rCFFBlx 43ikZ8PMC2IjXv4Mgf75w5zHa4+M0AoZTXGMho5yXabA+hidcZ76F41GWSsSuP/ShNkDY+RAaPFSk OF8i2JI3YSd1FWL53IKUERCPoT/nCZHxJ9VeXsxwhfOoF7k6wR5Qycl6l43Un2b/ExSvw5Mf2AOrj dkVXTcfkpBHPKfygqSMhUCEKCDT5/XoSRBWIM+wFzM4Ebxe8PW1tcV/tTtKUN0+kiKNvjQ0fbqcQc TSQq4j+1jb2N/Q==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrkedugddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufgjfhffkfgfgggtgfesthhqredttderjeenucfhrhhomheplfhohhhn ucghihgvghhlvgihuceojhhohhhnfiesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnh epiefftdehvdeivddtffefffffveekledujeeiledtudefheefhffhfeegjeetfeegnecu ffhomhgrihhnpehnvgifrghrthhishgrnhhsrdgtohhmnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhohhhnfidomhgvshhmthhprghuthhh phgvrhhsohhnrghlihhthidqieekjeektdelgeegqddujeejheefkeduiedqjhhohhhnfi eppehgnhhurdhorhhgsehnvgifrghrthhishgrnhhsrdgtohhmpdhnsggprhgtphhtthho pedt X-ME-Proxy: Feedback-ID: ib64945b7:Fastmail From: John Wiegley In-Reply-To: <86bk2bwjol.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 02 Aug 2024 08:57:46 +0300") References: <87r0b7akin.fsf@priss.frightenedpiglet.com> <86bk2bwjol.fsf@gnu.org> Date: Fri, 02 Aug 2024 15:32:07 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >>>>> Eli Zaretskii writes: >> The way the code above uses plist-member doesn't match the >> documentation. The test looks for the simple presence of a :defer >> key/value, and doesn't distinguish between any of the possible values: >> t, nil, or an integer. >>=20 >> Replacing plist-member with plist-get should fix the problem. A ":defer >> nil" would produce the same nil value as a missing :defer. > Thanks for the report and the analysis. > > John, any comments or suggestions about this? This sounds like a very good analysis, and I=E2=80=99m so glad you caught t= his. Yes, it shouldn=E2=80=99t just be a plist membership test; it should lookup the = member in the plist AND if it=E2=80=99s present and non-nil, then the truth of the co= ndition should be established. So, from: (when (and (not (plist-member args :load)) (not (plist-member args :defer)) (not (plist-member args :no-require))) (setq args (append args `(:load (,name))))) to: (when (and (not (plist-get args :load)) (not (plist-get args :defer)) (not (plist-get args :no-require))) (setq args (append args `(:load (,name))))) --=20 John Wiegley GPG fingerprint =3D 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2 From unknown Fri Aug 15 18:47:37 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Derek Upham Subject: bug#72414: closed (Re: bug#72414: 29.4; use-package :defer keyword does not honor ":defer nil") Message-ID: References: <86bk28sm7k.fsf@gnu.org> <87r0b7akin.fsf@priss.frightenedpiglet.com> X-Gnu-PR-Message: they-closed 72414 X-Gnu-PR-Package: emacs Reply-To: 72414@debbugs.gnu.org Date: Sun, 04 Aug 2024 08:55:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1722761702-30753-1" This is a multi-part message in MIME format... ------------=_1722761702-30753-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #72414: 29.4; use-package :defer keyword does not honor ":defer nil" which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 72414@debbugs.gnu.org. --=20 72414: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D72414 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1722761702-30753-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 72414-done) by debbugs.gnu.org; 4 Aug 2024 08:54:16 +0000 Received: from localhost ([127.0.0.1]:55474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saX0J-0007xc-N6 for submit@debbugs.gnu.org; Sun, 04 Aug 2024 04:54:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saX0G-0007x3-Vw for 72414-done@debbugs.gnu.org; Sun, 04 Aug 2024 04:54:13 -0400 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 1saWzo-00085v-Pg; Sun, 04 Aug 2024 04:53:45 -0400 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=I7b/fI4kDuKaThGBLLRPn+gHNCIbU+gmS1shZ3s0M+M=; b=gDHTAVEF1tqMmIW6Bp2t IOYMLsaR2UD5WdXeYfNAFOwPPUNEAJxzvflpEm5Jas7hZ+LQ5tkGBW04HcSBFudheQ5iQ7Zz9Q0Mn 03vt9nVrc6hd47d3iYaVBcusIo0PcEZETA/z4Tae9YOelOWPPfFN7rmA9QLPgeRZrqlS8CpAyb4M6 85K+ZDtdZkw11ZV3ALAwMjYiSTGhW6KD/XWiJ/W+Abrypa+eBRZk4V/cgqZoiPqu2aqbvVKXneWRn YdX+pnuF9Xs1QCQSeXmbf4jD+LTNBKLfMoQoSjHkCZuDNIaNqFX5rHD3LvtPChSTVf8jhFJxV0F2E U+Hd2YaZOpA2cg==; Date: Sun, 04 Aug 2024 11:53:35 +0300 Message-Id: <86bk28sm7k.fsf@gnu.org> From: Eli Zaretskii To: John Wiegley In-Reply-To: (message from John Wiegley on Fri, 02 Aug 2024 15:32:07 -0700) Subject: Re: bug#72414: 29.4; use-package :defer keyword does not honor ":defer nil" References: <87r0b7akin.fsf@priss.frightenedpiglet.com> <86bk2bwjol.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72414-done Cc: 72414-done@debbugs.gnu.org, derek_upham@mailfence.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: John Wiegley > Cc: Derek Upham , 72414@debbugs.gnu.org > Date: Fri, 02 Aug 2024 15:32:07 -0700 > > >>>>> Eli Zaretskii writes: > > >> The way the code above uses plist-member doesn't match the > >> documentation. The test looks for the simple presence of a :defer > >> key/value, and doesn't distinguish between any of the possible values: > >> t, nil, or an integer. > >> > >> Replacing plist-member with plist-get should fix the problem. A ":defer > >> nil" would produce the same nil value as a missing :defer. > > > Thanks for the report and the analysis. > > > > John, any comments or suggestions about this? > > This sounds like a very good analysis, and I’m so glad you caught this. Yes, > it shouldn’t just be a plist membership test; it should lookup the member in > the plist AND if it’s present and non-nil, then the truth of the condition > should be established. > > So, from: > > (when (and (not (plist-member args :load)) > (not (plist-member args :defer)) > (not (plist-member args :no-require))) > (setq args (append args `(:load (,name))))) > > to: > > (when (and (not (plist-get args :load)) > (not (plist-get args :defer)) > (not (plist-get args :no-require))) > (setq args (append args `(:load (,name))))) Thanks, installed on the emacs-30 release branch, and closing the bug. ------------=_1722761702-30753-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 1 Aug 2024 23:31:18 +0000 Received: from localhost ([127.0.0.1]:52085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZfGP-0003v9-Vm for submit@debbugs.gnu.org; Thu, 01 Aug 2024 19:31:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:53860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZfGM-0003v0-5d for submit@debbugs.gnu.org; Thu, 01 Aug 2024 19:31:16 -0400 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 1sZfG3-0000ge-BW for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2024 19:30:56 -0400 Received: from wilbur.contactoffice.com ([212.3.242.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZfG0-0007Xb-LO for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2024 19:30:54 -0400 Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id DF73BB5C for ; Fri, 2 Aug 2024 01:30:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1722555046; s=20240605-akrp; d=mailfence.com; i=derek_upham@mailfence.com; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=D7IJEPiu18pjoZXaTfFFrugsQJKqV1SCByclsEWBOiE=; b=uFPrQ3eA5BNKZHoEQw+ITj2tDixXP6U9pR7w0pHQCUbs7bepMPGvo/W4x1sSaue6 qds3dmu+axQq5YtBrdb4hU5Xlxco9GbcGwqFgyv4UlFNw5AF5OQDX+W5X5emy1TyM2t ZIWjQbdT7bcNEF0CpzyyaCHiULZVI7YpDZJ53oQ/1Mjax4KakQFS5LGTPKbhTXPDwu6 RNQoQhwC2AMH9SfGJwYauJogg8/UFEcCLeKns6n1x9p0vi9tLNY8ppjJkUSUNZhk9g+ 2rkls6IMh6DV85Fw6lm0Io/iuNz+H3JklsTFBFeGF0LY/AfhMwCLr095BYNEBYHbqNp hwHJMqwUdw== Received: by smtp.mailfence.com with ESMTPSA for ; Fri, 2 Aug 2024 01:30:42 +0200 (CEST) Received: from [::1] (helo=priss.frightenedpiglet.com) by priss.frightenedpiglet.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97) (envelope-from ) id 1sZfFo-00000000WtL-35Pl for bug-gnu-emacs@gnu.org; Thu, 01 Aug 2024 16:30:40 -0700 From: Derek Upham To: bug-gnu-emacs@gnu.org Subject: 29.4; use-package :defer keyword does not honor ":defer nil" Date: Thu, 01 Aug 2024 16:30:40 -0700 Message-ID: <87r0b7akin.fsf@priss.frightenedpiglet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ContactOffice-Account: com:175140567 Received-SPF: pass client-ip=212.3.242.68; envelope-from=derek_upham@mailfence.com; helo=wilbur.contactoffice.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) - The relevant file is "lisp/use-package/use-package-core.el". - The function is "use-package-normalize-keywords". - This is as of commit 4c6e9f5b004, current for this file on the "emacs-30" tag. Near the bottom of the use-package-normalize-keywords function, we have the following code block. ;; If at this point no :load, :defer or :no-require has been seen, then ;; :load the package itself. (when (and (not (plist-member args :load)) (not (plist-member args :defer)) (not (plist-member args :no-require))) (setq args (append args `(:load (,name))))) The intent is that we add an immediate-load instruction to the keyword list, if there is no reason to not add it. We have a couple of possible reasons to not add it: 1. There's already a :load keyword. 2. We have asked use-package to :defer loading. 3. We have asked use-package to not require the package, to avoid certain byte-compilation problems. The Use-Package documentation section 3.2 goes into more detail about the :defer keyword behavior in (2). If you customize the user option =E2=80=98use-package-always-defer=E2=80= =99 to non-=E2=80=98nil=E2=80=99, the =E2=80=98use-package=E2=80=99 macro will = behave as if =E2=80=98:defer t=E2=80=99 is always specified. This can be overridden for individual declarations using either =E2=80=98:defer nil=E2=80=99 or =E2=80=98:demand t=E2=80=99= (*note Forcing loading::). The way the code above uses plist-member doesn't match the documentation. The test looks for the simple presence of a :defer key/value, and doesn't distinguish between any of the possible values: t, nil, or an integer. Replacing plist-member with plist-get should fix the problem. A ":defer nil" would produce the same nil value as a missing :defer. In GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0) of 2024-06-29, modified by Debian built on sbuild Windowing system distributor 'The X.Org Foundation', version 11.0.12101011 System Description: Debian GNU/Linux trixie/sid Configured using: 'configure --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/libexec --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --with-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/29.4/site-lisp:= /usr/local/share/emacs/site-lisp:/usr/share/emacs/29.4/site-lisp:/usr/share= /emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --with-native-compilation --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/libexec --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --with-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/29.4/site-lisp:= /usr/local/share/emacs/site-lisp:/usr/share/emacs/29.4/site-lisp:/usr/share= /emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --with-native-compilation --with-cairo --with-x=3Dyes --with-x-toolkit=3Dgtk3 --with-toolkit-scroll-bars 'CFLAGS=3D-g -O2 -Werror=3Dimplicit-function-declaration -ffile-prefix-map=3D/build/reproducible-path/emacs-29.4+1=3D. -fstack-prot= ector-strong -fstack-clash-protection -Wformat -Werror=3Dformat-security -fcf-protection -Wall' 'CPPFLAGS=3D-Wdate-time -D_FORTIFY_SOURCE=3D2' LDFLAGS=3D-Wl,-z,relro' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix --=20 Derek Upham derek_upham@mailfence.com ------------=_1722761702-30753-1--