branch: externals/denote
commit c7851f6130356071a70defca90dbd30834f0e6b9
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Refactor denote--buffer-file-names
---
denote.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/denote.el b/denote.el
index 44261c397f..e84cfa7e60 100644
--- a/denote.el
+++ b/denote.el
@@ -1604,13 +1604,14 @@ where the former does not read dates without a time
component."
(date-to-time datetime)))
(defun denote--buffer-file-names ()
- "Return file names of active buffers."
- (seq-filter
- #'denote-file-is-note-p
- (delq nil
- (mapcar
- #'buffer-file-name
- (buffer-list)))))
+ "Return file names of Denote buffers."
+ (seq-keep
+ (lambda (buffer)
+ (when-let (((buffer-live-p buffer))
+ (file (buffer-file-name buffer))
+ ((denote-file-is-note-p file)))
+ file))
+ (buffer-list)))
;; In normal usage, this should only be relevant for `denote-date',
;; otherwise the identifier is always unique (we trust that no-one