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#72414: 29.4; use-package :defer keyword does not honor ":defer nil" Date: Fri, 02 Aug 2024 08:57:46 +0300 Message-ID: <86bk2bwjol.fsf@gnu.org> References: <87r0b7akin.fsf@priss.frightenedpiglet.com> 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="23937"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72414@debbugs.gnu.org To: Derek Upham , John Wiegley Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 02 08:01:18 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 1sZlLp-000653-8I for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Aug 2024 08:01:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZlLT-00006P-4x; Fri, 02 Aug 2024 02:00:55 -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 1sZlLJ-00005T-8d for bug-gnu-emacs@gnu.org; Fri, 02 Aug 2024 02:00:45 -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 1sZlLI-0007eP-V8 for bug-gnu-emacs@gnu.org; Fri, 02 Aug 2024 02:00:44 -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:References:In-Reply-To:From:Date:To:Subject; bh=HFB/uNALKLMGNiOPrhDNxi+B+TW71C0nN8OObKnW5V4=; b=rcUJlH4Wbz+UENilv6AA++bXgxpCvvgYBL63yuakpEHOgskR98z8Ju/aIuBPyH9Q27lEKr932TtsiHWtyMIw4EhzbIsxsKk4t66sChwmivbniE0X5aFQ6J15C5P39m/K4mqNHpUfxYJjoCnKkdKeBSgvzg/jSrKFUaGJjlpCImCHZR6lpPrcbhGRiiISTrCmgYyUZIV5uuklHF27zf7NAm7z0CCucxKBpWmWLGd5R8ynVqnFaMr+WwI60Lbeefy7b34QBHKGVcBcnsiNzoQq4OvwQwEA9Va95GU6aksV3y/YsnRsyAM0p40ldnuTuJghZug9hdFG9ezycfRF0lDqlw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sZlLa-0005OC-IL for bug-gnu-emacs@gnu.org; Fri, 02 Aug 2024 02:01:02 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 72414-submit@debbugs.gnu.org id=B72414.172257843120660 (code B ref 72414); Fri, 02 Aug 2024 06:01:02 +0000 Original-Received: (at 72414) by debbugs.gnu.org; 2 Aug 2024 06:00:31 +0000 Original-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 Original-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 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 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==; In-Reply-To: <87r0b7akin.fsf@priss.frightenedpiglet.com> (bug-gnu-emacs@gnu.org) 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:289625 Archived-At: > 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?