From b04f322a9bd0e5376eca0d4c2961a8a076eeb9bb Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 11 Dec 2020 18:58:41 +0100 Subject: [PATCH] Also sort the totals section by size * lisp/emacs-lisp/memory-report.el (memory-report): Sort the totals by size, too. --- lisp/emacs-lisp/memory-report.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/memory-report.el b/lisp/emacs-lisp/memory-report.el index 0184c7ed8a5..c88d9f2768a 100644 --- a/lisp/emacs-lisp/memory-report.el +++ b/lisp/emacs-lisp/memory-report.el @@ -59,7 +59,9 @@ by counted more than once." (if (listp report) (push report summaries) (push report details))) - (dolist (summary (nreverse summaries)) + (dolist (summary (seq-sort (lambda (e1 e2) + (> (cdr e1) (cdr e2))) + summaries)) (insert (format "%s %s\n" (memory-report--format (cdr summary)) (car summary)))) -- 2.39.2