Subject: Re: bug#57503: 28.1.91; package-selected-packages should not be saved to custom-file

From: Robert Pluim <[email-masked]>
Date: Tue, 06 Sep 2022 10:18:03 +0200

>>>>> On Mon, 05 Sep 2022 21:04:52 +0200, Lars Ingebrigtsen <[email-masked]> said:
    >> Of course one use case that breaks is to do
    >> 
    emacs-29-> emacs-28, *delete* some packages, and then go back to
    >> emacs-29, which will pick up the old multi-session value.
    >> 
    >> I guess we could change emacs-29 to refresh the multi-session value
    >> every time you run `list-packages'.

    Lars> Hm.  Or...  refresh the value if the .emacs.d/elpa directory has fresher
    Lars> contents than the multisession variable, but I don't know whether that's
    Lars> faster.

How do we define 'fresher'? Anyway, if in doubt, use brute force:

(define-multisession-variable package-selected-packages-ms
                              (package--find-non-dependencies))

works fine. We could even condition it on `package-selected-packages'
being non-nil.

Robert
--