> What would the prompt say in this case?
Perhaps something along the lines of "Save <package> permanently to package-selected-packages? (y or n)". Then a variable can be introduced to determine whether or not this prompt should be displayed, or if it should even be saved at all. A variable similar to this is `vc-follow-symlinks', which can have the values nil, ask, or t.
> wouldn't that mean Emacs will not know these packages
> weer selected next time it starts?
Yes, so if you relied on its functionality then it could cause issues. This would be something for the user to decide.
>I see no reason yet why this particular customization is different as to
> require a specialized solution just for it. Can you tell why you
> think it is different?
I do write Lisp for almost all of my customizations, but this isn't really a case where I think behaviour should be handed off to the users to manually tune. For instance, I don't want to have custom Lisp in my init file handling all of my abbrevs, yasnippets, or words in my personal Emacs dictionary. All of these have their own files to which they save data to. I think that the list of `selected' packages, if saved, should go to its own file like the above.
Other customized variables are easy to maintain. `package-selected-packages' on the other hand is a bit more dynamic and can become quite large and difficult to maintain.
I can't use the customize interface for this variable since as far as I'm aware the customize file isn't great for conditionally assigning variables depending on other variables at run-time (like system-type), though perhaps I'm wrong.
So customize seems to be out of the picture here. Without a separate save file, I'd have to use my init file for the job. Certainly it's possible to conditionally setq the variable depending on the machine state, but this can become quite unwieldy with a large number of packages, and with more and more different machines with different packages that you want in this list. There could be a lot of work needed to manually change all of these branches for every package installed/removed.
When I save an abbrev or a dictionary word, I don't want to manually edit my init file corresponding to that. Likewise, I'd rather not have to edit this variable every time I add/drop a package. A separate file, that can be made machine-specific, that holds this data would mean that the users don't have to edit it themselves, nor do they have to worry about the variable being overwritten when the same configuration is moved to a different machine and back.