[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 143f6f65ef 3/5: Merge pull request #212 from jea
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 143f6f65ef 3/5: Merge pull request #212 from jeanphilippegg/hidden-directories |
Date: |
Mon, 1 Jan 2024 06:57:41 -0500 (EST) |
branch: externals/denote
commit 143f6f65efd66f3ba31c4445aee6860cdb77567e
Merge: 0a0b63db8d 5e348d429a
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: GitHub <noreply@github.com>
Merge pull request #212 from jeanphilippegg/hidden-directories
Fix issue #209
---
denote.el | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/denote.el b/denote.el
index 80c9d7ee9c..ea5247881f 100644
--- a/denote.el
+++ b/denote.el
@@ -778,6 +778,17 @@ FILE must be an absolute path."
(and denote-excluded-directories-regexp
(string-match-p denote-excluded-directories-regexp file)))
+(defun denote--directory-files-recursively-predicate (file)
+ "Predicate used by `directory-files-recursively' on FILE.
+
+Return t if FILE is valid, else return nil."
+ (let ((rel (denote-get-file-name-relative-to-denote-directory file)))
+ (cond
+ ((string-match-p "\\`\\." rel) nil)
+ ((string-match-p "/\\." rel) nil)
+ ((denote--exclude-directory-regexp-p rel) nil)
+ ((file-readable-p file)))))
+
(defun denote--directory-all-files-recursively ()
"Return list of all files in variable `denote-directory'.
Avoids traversing dotfiles (unconditionally) and whatever matches
@@ -786,13 +797,7 @@ Avoids traversing dotfiles (unconditionally) and whatever
matches
(denote-directory)
directory-files-no-dot-files-regexp
:include-directories
- (lambda (f)
- (cond
- ((string-match-p "\\`\\." f) nil)
- ((string-match-p "/\\." f) nil)
- ((denote--exclude-directory-regexp-p f) nil)
- ((file-readable-p f))
- (t)))
+ #'denote--directory-files-recursively-predicate
:follow-symlinks))
(defun denote--directory-get-files ()