Subject: bug#76978: [PATCH] package.el: Add built-in version check and loaded package marking

From: Stefan Monnier <[email-masked]>
Date: Tue, 18 Mar 2025 23:08:29 -0400

>> Hmm... the two terms do not mean the same thing.  "Loaded" refers to the
>> package's `.el` files having been `load`ed, whereas "activated" means
>> that the package's directory has been added to `load-path` and its
>> `<PKG>-autoloads.el` file has been loaded.
>>
>> The variable `package-activated-list` keeps track, as the name suggests,
>> of packages that have been activated, not loaded.
>>
>   Should we mark packages in "Other versions" as "activated" or "loaded"
>   (like the GNU ELPA package Marginalia, which shows "Loaded" when
>   calling `locate-library`)?

AFAICT, that shows whether a given file was loaded or not, so "loaded"
sounds like the right term.

>   Currently, "Other versions" redundantly includes the described
>   package. I aim to improve this by indicating if the package is in
>   `load-path`, helping users identify active or loaded packages.
>   What do you recommend?

Not sure what is the question, but I do think we want to show which
packages are "activated" (or "active").  "Loaded" would be a lot more
difficult: we have a way to test if a given *file* has been
loaded, but when it comes to a *package* the meaning is not even
clear (it may be that some of its files have been loaded but not all).

I'm not completely sure how to figure that out, tho.
`package-activated-list` only gives the name of the packages but not
their version.  In some cases you could look for the `<PKG>-autoloads`
file in `load-history` (and then get the version from the directory name
or from the nearby `<PKG>-pkg.el` file), but that won't work if the
package has been activated via package-quickstart.  Maybe we need to
change the package activation to keep more information about the
activated packages.

>> Also, I had questions in my previous review and I haven't seen any
>> answer to them (most importantly about copyright paperwork).
> Yes, I have signed the copyright paperwork.

Great.  I can't find your name in the FSF's copyright list, for
some reason.  Have you signed very recently (and the FSF's copyright
clerk just hasn't updated the list yet?) or maybe you used another
name/email?  In that last case, please contact the FSF clerk and ask them
to add the email you use habitually (such as the one I'm replying to) to
avoid such problems in the future.

        Stefan