all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Wiegley <johnw@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 72414@debbugs.gnu.org, Derek Upham <derek_upham@mailfence.com>
Subject: bug#72414: 29.4; use-package :defer keyword does not honor ":defer nil"
Date: Fri, 02 Aug 2024 15:32:07 -0700	[thread overview]
Message-ID: <m2cymqsgig.fsf@gnu.org> (raw)
In-Reply-To: <86bk2bwjol.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 02 Aug 2024 08:57:46 +0300")

>>>>> Eli Zaretskii <eliz@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





  reply	other threads:[~2024-08-02 22:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-01 23:30 bug#72414: 29.4; use-package :defer keyword does not honor ":defer nil" Derek Upham via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-02  5:57 ` Eli Zaretskii
2024-08-02 22:32   ` John Wiegley [this message]
2024-08-04  8:53     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2cymqsgig.fsf@gnu.org \
    --to=johnw@gnu.org \
    --cc=72414@debbugs.gnu.org \
    --cc=derek_upham@mailfence.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.