unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ivan Sokolov <ivan-p-sokolov@ya.ru>
To: emacs-devel@gnu.org
Subject: [PATCH v2] Sort package-selected-packages on save
Date: Mon, 03 Apr 2023 00:10:51 +0300	[thread overview]
Message-ID: <87ttxyj8h0.fsf@ya.ru> (raw)
In-Reply-To: <87a600mmdy.fsf@ya.ru> (Ivan Sokolov's message of "Sun, 26 Mar 2023 02:39:21 +0300")

[-- Attachment #1: Type: text/plain, Size: 74 bytes --]

As Philip suggested I removed the option and make sorting unconditional.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] Sort package-selected-packages on save --]
[-- Type: text/x-patch, Size: 963 bytes --]

From 071abcf1510489e5fa109384c6004008a2c0208f Mon Sep 17 00:00:00 2001
From: Ivan Sokolov <ivan-p-sokolov@ya.ru>
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 0258ed52bee..bf423143059 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1974,7 +1974,7 @@ Used to populate `package-selected-packages'."
 (defun package--save-selected-packages (&optional value)
   "Set and save `package-selected-packages' to VALUE."
   (when value
-    (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


  parent reply	other threads:[~2023-04-02 21:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-25 23:39 [PATCH] Option for sorting package-selected-packages Ivan Sokolov
2023-03-26 10:24 ` Philip Kaludercic
2023-03-26 12:00   ` Ivan Sokolov
2023-04-02 21:10 ` Ivan Sokolov [this message]
2023-10-01 12:27   ` [PATCH v2] Sort package-selected-packages on save Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ttxyj8h0.fsf@ya.ru \
    --to=ivan-p-sokolov@ya.ru \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).