]> git.eshelyaron.com Git - emacs.git/commitdiff
Sort package-selected-packages on save
authorIvan Sokolov <ivan-p-sokolov@ya.ru>
Fri, 24 Mar 2023 20:27:13 +0000 (23:27 +0300)
committerStefan Kangas <stefankangas@gmail.com>
Sun, 1 Oct 2023 12:25:13 +0000 (14:25 +0200)
lisp/emacs-lisp/package.el

index 5a508882dc3b224f0c55e520258512c91c8a74a5..e23a61c58a426edbfd0f78af1a96638198e97191 100644 (file)
@@ -1986,7 +1986,7 @@ Used to populate `package-selected-packages'."
     ;; 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))
+    (setq package-selected-packages (sort value #'string<)))
   (if after-init-time
       (customize-save-variable 'package-selected-packages package-selected-packages)
     (add-hook 'after-init-hook #'package--save-selected-packages)))