From a96dc984dd6fd6e81a1ee53e4d82bd7ff9789f49 Mon Sep 17 00:00:00 2001 From: Ivan Sokolov Date: Fri, 24 Mar 2023 23:27:13 +0300 Subject: [PATCH] Sort package-selected-packages on save --- lisp/emacs-lisp/package.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 5a508882dc3..e23a61c58a4 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -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))) -- 2.39.2