emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 610105ee81b: Update selected packages when deleting last package


From: Stefan Kangas
Subject: master 610105ee81b: Update selected packages when deleting last package
Date: Sat, 2 Sep 2023 12:26:49 -0400 (EDT)

branch: master
commit 610105ee81bbf79f72d4efb46d0caddf8d654cf1
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Update selected packages when deleting last package
    
    * lisp/emacs-lisp/package.el (package--save-selected-packages): Allow
    setting 'package-selected-packages' to a nil value.  (bug#65475)
---
 lisp/emacs-lisp/package.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index e1172d69bf0..43842cfea73 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1982,7 +1982,10 @@ Used to populate `package-selected-packages'."
 
 (defun package--save-selected-packages (&optional value)
   "Set and save `package-selected-packages' to VALUE."
-  (when value
+  (when (or value after-init-time)
+    ;; It is valid to set it to nil, for example when the last package
+    ;; is uninstalled.  But it shouldn't be done at init time, to
+    ;; avoid overwriting configurations that haven't yet been loaded.
     (setq package-selected-packages value))
   (if after-init-time
       (customize-save-variable 'package-selected-packages 
package-selected-packages)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]