branch: externals/denote-sequence
commit c94f52760b65372bd1122f70ce05434c4c77cf41
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Remove unhelpful function for sorting and handle each case on its own
---
denote-sequence.el | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/denote-sequence.el b/denote-sequence.el
index 16feb23749..b181b18204 100644
--- a/denote-sequence.el
+++ b/denote-sequence.el
@@ -554,22 +554,23 @@ means to pad the full length of the sequence."
"=")
(string-pad s 32 32 :pad-from-start))))
-(defun denote-sequence--smaller-p (sequence1 sequence2)
- "Return non-nil if SEQUENCE1 is smaller than SEQUENCE2."
- (string<
- (denote-sequence--pad sequence1 'all)
- (denote-sequence--pad sequence2 'all)))
-
(defun denote-sequence-sort-sequences (sequences)
"Sort SEQUENCES according to their sequence.
Also see `denote-sequence-sort-files'."
- (sort sequences #'denote-sequence--smaller-p))
+ (sort
+ sequences
+ (lambda (sequence1 sequence2)
+ (string<
+ (denote-sequence--pad sequence1 'all)
+ (denote-sequence--pad sequence2 'all)))))
(defun denote-sequence--file-smaller-p (file1 file2)
"Return non-nil if FILE1 has a smaller sequence than FILE2."
(let ((sequence1 (denote-retrieve-filename-signature file1))
(sequence2 (denote-retrieve-filename-signature file2)))
- (denote-sequence--smaller-p sequence1 sequence2)))
+ (string<
+ (denote-sequence--pad sequence1 'all)
+ (denote-sequence--pad sequence2 'all))))
(defun denote-sequence-sort-files (files-with-sequence)
"Sort FILES-WITH-SEQUENCE according to their sequence.