Subject: Re: bug#53885: 28.0.51 [PATCH] Autoload package-installed-p

From: Corwin Brust <[email-masked]>
Date: Thu, 10 Feb 2022 01:21:59 -0600

On Thu, Feb 10, 2022 at 12:45 AM Lars Ingebrigtsen <[email-masked]> wrote:
>
> Eli Zaretskii <[email-masked]> writes:
>
> > Thanks, but I don't think I understand the relevance, probably because
> > I don't use use-package.  Why do you need package-installed-p to be
> > autoloaded in this scenario, and why cannot use-package do that by
> > itself?
>
> Yes, that's the puzzling thing.  But I've never used use-package
> myself -- I assumed that it was a framework built around package.el, but
> perhaps it's not related to package.el at all?
>

I'm sure I follow the logic here.  If use-package isn't installed, how
does it matter what relationship it may have to package.el?

That said, one can replace `use-package' with any feature not present
in Emacs as shipped.

Perhaps the use-case is more generally expressed as such:

I would like to have my init scripts automatically install a package
that isn't available "out of the box", but only if that feature hasn't
already been installed.

As things presently stand, `package-installed-p' is nearly perfect for
this, however one must take care to ensure package.el has been
manually loaded before calling it, in order to avoid Emacs raising the
error shown in the original report.