Subject: Re: bug#72160: 29.3; package buglet

From: Stefan Kangas <[email-masked]>
Date: Sat, 1 Mar 2025 19:22:05 -0800

Version: 31.1

Devon Sean McCullough <[email-masked]> writes:

> Strings and symbols should be equally acceptable package designators.
>
> (use-package 'xr) ; (wrong-type-argument symbolp 'xr)
> Should work like (use-package "xr")

I can see an argument in favor of more DWIM here, because this is
supposed to be a _help_ for configuring Emacs.  Why not make it as
helpful as possible?

On the other hand, probably a better error message is all that is
needed, and it will help keep things consistent and less confusing
across examples and documentation in the wild.

So I have made this have a better error on master (commit 38782e684bf),
and similarly when using a quoted symbol:

String where there should be a symbol.  Hint: say this instead:
‘(use-package foo ...)’

> (package-install "xr") ; (error "Package ‘xr’ is unavailable")
> Should work like (package-install 'xr)
> instead of erring with that awfully misleading error message.

I was considering just improving the error message, however
`package-upgrade` already accepts either a symbol or a string.

So I changed this function to accept a string also, to be more
consistent (commit 735eace97b8).

With that, I'm closing this bug report.