Subject: Re: bug#72414: 29.4; use-package :defer keyword does not honor ":defer nil"
From: Eli Zaretskii <[email-masked]>
To: John Wiegley <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sun, 04 Aug 2024 11:53:35 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: John Wiegley <[email-masked]>
> Cc: Derek Upham <[email-masked]>,  [email-masked]
> Date: Fri, 02 Aug 2024 15:32:07 -0700
> 
> >>>>> Eli Zaretskii <[email-masked]> 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.