GNU bug report logs -
#72414
29.4; use-package :defer keyword does not honor ":defer nil"
Previous Next
Reported by: Derek Upham <derek_upham <at> mailfence.com>
Date: Thu, 1 Aug 2024 23:32:02 UTC
Severity: normal
Found in version 29.4
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 72414 <at> debbugs.gnu.org (full text, mbox):
>>>>> Eli Zaretskii <eliz <at> gnu.org> 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)))))
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
This bug report was last modified 346 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.