unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattias.engdegard@gmail.com>
To: 59941@debbugs.gnu.org
Cc: John Wiegley <johnw@newartisans.com>,
	Stefan Kangas <stefankangas@gmail.com>
Subject: bug#59941: use-package-defaults type not updated for added keywords :pin, :ensure etc
Date: Sat, 10 Dec 2022 11:41:42 +0100	[thread overview]
Message-ID: <CBE0816E-71C1-4481-B12B-73EEEE71D973@gmail.com> (raw)

The type of `use-package-defaults` does not include the keywords :pin and :ensure, since these are added to `use-package-keywords` after the declaration of the former.

As a consequence these keywords cannot occur in `use-package-defaults` when using the interactive customisation interface, and since they are present in the default value, the `test-custom-opts` test fails with a type mismatch:

variable: use-package-defaults
   value: ((:config '(t) t) (:init nil t) (:catch t (lambda (name args) (not use-package-expand-minimally))) (:defer use-package-always-defer (lambda (name args) (and use-package-always-defer (not (plist-member args :defer)) (not (plist-member args :demand))))) (:demand use-package-always-demand (lambda (name args) (and use-package-always-demand (not (plist-member args :defer)) (not (plist-member args :demand))))) (:ensure (list use-package-always-ensure) (lambda (name args) (and use-package-always-ensure (not (plist-member args :load-path))))) (:pin use-package-always-pin use-package-always-pin))
    type: (repeat (list (choice :tag "Keyword" (const :disabled) (const :load-path) (const :requires) (const :defines) (const :functions) (const :preface) (const :if) (const :when) (const :unless) (const :no-require) (const :catch) (const :after) (const :custom) (const :custom-face) (const :bind) (const :bind*) (const :bind-keymap) (const :bind-keymap*) (const :interpreter) (const :mode) (const :magic) (const :magic-fallback) (const :hook) (const :commands) (const :autoload) (const :init) (const :defer) (const :demand) (const :load) (const :config)) (choice :tag "Default value" sexp function) (choice :tag "Enable if non-nil" sexp function)))

There are various ways to fix this. Easiest is probably to cease pretending that :pin and :ensure are somehow special and just include them in `use-package-keywords` from the start instead of adding them afterwards.

Alternatives include making the defcustom type less specific and allow any keyword, or modifying that type after adding keywords (a bit messy).






             reply	other threads:[~2022-12-10 10:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-10 10:41 Mattias Engdegård [this message]
2022-12-11 16:10 ` bug#59941: use-package-defaults type not updated for added keywords :pin, :ensure etc Mattias Engdegård

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CBE0816E-71C1-4481-B12B-73EEEE71D973@gmail.com \
    --to=mattias.engdegard@gmail.com \
    --cc=59941@debbugs.gnu.org \
    --cc=johnw@newartisans.com \
    --cc=stefankangas@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).