branch: externals/denote commit d2f14291bf0787c2294fb71b66429dfc4957293c Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Move let bound filter into its own function Makes it easier to read. --- denote.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/denote.el b/denote.el index 9c4abb2f55..58ea9ed912 100644 --- a/denote.el +++ b/denote.el @@ -329,17 +329,21 @@ FILE must be an absolute path." ;;;; Keywords +(defun denote--directory-files-recursively (directory) + "Return expanded files in DIRECTORY recursively." + (mapcar + (lambda (s) (expand-file-name s)) + (seq-remove + (lambda (f) + (not (denote--only-note-p f))) + (directory-files-recursively directory directory-files-no-dot-files-regexp t)))) + (defun denote--directory-files (&optional absolute) "List note files. If optional ABSOLUTE, show full paths, else only show base file names that are relative to the variable `denote-directory'." (let* ((default-directory (denote-directory)) - (files (mapcar - (lambda (s) (expand-file-name s)) - (seq-remove - (lambda (f) - (not (denote--only-note-p f))) - (directory-files-recursively default-directory directory-files-no-dot-files-regexp t))))) + (files (denote--directory-files-recursively default-directory))) (if absolute files (mapcar