emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/dired-duplicates c2cb23cd0c 07/57: Allow sorting by fil


From: ELPA Syncer
Subject: [elpa] externals/dired-duplicates c2cb23cd0c 07/57: Allow sorting by filesize in ascending or descending order
Date: Sat, 4 Nov 2023 06:58:26 -0400 (EDT)

branch: externals/dired-duplicates
commit c2cb23cd0c35d45d2c2015f8127558bf85a327d5
Author: Harald Judt <h.judt@gmx.at>
Commit: Harald Judt <h.judt@gmx.at>

    Allow sorting by filesize in ascending or descending order
---
 find-dupes-dired.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/find-dupes-dired.el b/find-dupes-dired.el
index 79ea044260..ccef8423de 100644
--- a/find-dupes-dired.el
+++ b/find-dupes-dired.el
@@ -12,6 +12,14 @@
   :tag "Checksum executable"
   :type 'string)
 
+(defcustom find-dupes-size-comparison-function
+  #'>
+  "The comparison function used for sorting grouped results in ascending or 
descending order."
+  :group 'find-dupes-dired
+  :tag "Ascending or descending file size sort order"
+  :type '(choice (const :tag "Ascending" #'<)
+                 (const :tag "Descending" #'>)))
+
 (defvar find-dupes-directories nil
   "List of directories that will be searched for duplicate files.")
 
@@ -74,7 +82,7 @@ separator file specified by `find-dupes-separator-file'."
            with sorted-sums = (cl-sort
                                (cl-loop for k being the hash-key in 
dupes-table using (hash-value v)
                                         collect (list k (first v)))
-                               #'>
+                               find-dupes-size-comparison-function
                                :key #'second)
            for (checksum) in sorted-sums
            append (rest (gethash checksum dupes-table))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]