From: Ivan Sokolov Date: Fri, 24 Mar 2023 20:27:13 +0000 (+0300) Subject: Sort package-selected-packages on save X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a96dc984dd6fd6e81a1ee53e4d82bd7ff9789f49;p=emacs.git Sort package-selected-packages on save --- 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)))