conao3 / leaf.el

Flexible, declarative, and modern init.el package configuration
GNU General Public License v3.0
500 stars 27 forks source link

In `:package` keyword, make sure already installed packages are also saved to `package-selected-packages` #504

Closed gksato closed 2 years ago

gksato commented 2 years ago

Description

I'd like :package keyword to save the target packages into the variable package-selected-packages no matter whether they are already installed or not, and that is all.

When leaf processes the keyword :package, the handler leaf-handler-package will just call package-install only if the package is not yet installed; otherwise it does nothing. As a result, we will have an empty package-selected-package when we have already installed all the :ensured packages, which is painful, for example, when we wanna call package-autoremove. It is best if we write the target packages of :package into the variable package-selected-package when we don't call package-install. This can be easily and cleanly achieved with package.el's function package--update-selected-packages. I'll follow up with a PR.

gksato commented 2 years ago

Uh-oh. this is a duplicate of #294...