Subject: Re: bug#71356: use-package doesn't load org from elpa

From: Philip Kaludercic <[email-masked]>
Date: Thu, 06 Jun 2024 06:15:44 +0000

Eli Zaretskii <[email-masked]> writes:

>> From: Pedro Andres Aranda Gutierrez <[email-masked]>
>> Date: Thu, 6 Jun 2024 07:46:31 +0200
>> Cc: Eli Zaretskii <[email-masked]>, Philip Kaludercic <[email-masked]>, [email-masked]
>> 
>> Andrea is right. Reading through all the documentation, I implied
>> that use-package would upgrade built-in packages if I pinned them to an archive
>> and I :ensure'd them. 
>> 
>> Use case: want to upgrade org from the 9.6.x version packaged with master to the
>> 9.7.x version available in elpa. 
>> 
>> Maybe this is more a FR and if so, we could move this to the list and have an informed 
>> discussion there.
>
> I'd like to hear from Philip.  If use-package just uses package.el,
> then the behavior is expected.

Sorry for the delayed response;  I don't think that has to be expected.
While use-package can utilise package.el for package management, my
impression is that it is at liberty to be more flexible/declarative.  

> Do you have package-install-upgrade-built-in set non-nil?  If not, can
> you set it non-nil and try the recipe again?

I have tried it out myself, and it doesn't appear to do anything.  The
issue looks like that `package-installed-p' doesn't respect
package-install-upgrade-built-in or :pin.

> As for a feature request: what exactly is the feature requested here?
> Are you saying that use-package should automatically upgrade built-in
> packages?  If so, I don't think this will fly, since it would mean
> inconsistencies with package-install.

IIUC the feature would be that if a use-package form has a

     :pin gnu

argument, then this is an indication that we want to install the package
from GNU ELPA, disregarding the fact that Emacs already has a built-in
version of the same package.  Sort of a package-local version of
`package-install-upgrade-built-in'.

I am not familiar with the use-package code, but it seems like we could
implement this generally in package-install, by checking
`package-pinned-packages'.

-- 
	Philip Kaludercic on peregrine