[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 1318e4175e 04/10: Tweak denote-sort-files for cl
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/denote 1318e4175e 04/10: Tweak denote-sort-files for clarity |
|
Date: |
Thu, 30 Nov 2023 00:57:46 -0500 (EST) |
branch: externals/denote
commit 1318e4175efc0a3dc7c6c613a382f9a88c5f71e6
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Tweak denote-sort-files for clarity
---
denote-sort.el | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/denote-sort.el b/denote-sort.el
index 5499d62f5f..d2a73862a1 100644
--- a/denote-sort.el
+++ b/denote-sort.el
@@ -67,23 +67,20 @@ two signature values." component)
(defun denote-sort-files (files component &optional reverse)
"Returned sorted list of Denote FILES.
-With optional COMPONENT as a keyword of `:signature', `:title',
-`:keywords', sort files based on the corresponding file name
-component.
+With COMPONENT as a symbol among `denote-sort-components',
+sort files based on the corresponding file name component.
-Without COMPONENT, do not sort: keep the original date-based
+With COMPONENT as a nil value keep the original date-based
sorting which relies on the identifier of each file name.
With optional REVERSE as a non-nil value, reverse the sort order."
(let* ((files-to-sort (copy-sequence files))
- (sorted-files (if component
- (sort files
- (pcase component
- (:title #'denote-sort-title-lessp)
- (:keywords #'denote-sort-keywords-lessp)
- (:signature #'denote-sort-signature-lessp)
- (_ #'ignore)))
- files-to-sort)))
+ (sort-fn (when component
+ (pcase component
+ ('title #'denote-sort-title-lessp)
+ ('keywords #'denote-sort-keywords-lessp)
+ ('signature #'denote-sort-signature-lessp))))
+ (sorted-files (if sort-fn (sort files sort-fn) files-to-sort)))
(if reverse
(reverse sorted-files)
sorted-files)))
- [elpa] externals/denote updated (edeaaa735e -> 97f34bdc0c), ELPA Syncer, 2023/11/30
- [elpa] externals/denote cf3c2b8cbe 03/10: Change the arity of denote-sort-files to make only REVERSE be optional, ELPA Syncer, 2023/11/30
- [elpa] externals/denote 1999217a51 06/10: Make sorting work for missing components; remove the macro, ELPA Syncer, 2023/11/30
- [elpa] externals/denote 0ed067e5a8 05/10: Rename symbols for consistency; make denote-sort-component-prompt public, ELPA Syncer, 2023/11/30
- [elpa] externals/denote 97f34bdc0c 10/10: Document denote-sort.el, with 'denote-sort-dired' in particular, ELPA Syncer, 2023/11/30
- [elpa] externals/denote db31cca8fa 02/10: Clarify denote-sort-components docstring, ELPA Syncer, 2023/11/30
- [elpa] externals/denote 3cd4999d1c 01/10: Rename denote-sort-files-keys to denote-sort-components; change to list of symbols, ELPA Syncer, 2023/11/30
- [elpa] externals/denote 4050bf6caf 08/10: Fix denote-org-dblock-add-files case of REVERSE without SORT-BY-COMPONENT, ELPA Syncer, 2023/11/30
- [elpa] externals/denote c98e793eef 07/10: Make 'denote-files' Org dynamic block leverage denote-sort, ELPA Syncer, 2023/11/30
- [elpa] externals/denote 1318e4175e 04/10: Tweak denote-sort-files for clarity,
ELPA Syncer <=
- [elpa] externals/denote 59f2a61caf 09/10: Document sorting facilities for 'denote-files' Org dynamic block, ELPA Syncer, 2023/11/30