[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 5e348d429a 2/5: Allow hidden files in parent dir
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 5e348d429a 2/5: Allow hidden files in parent directories of denote-directory |
Date: |
Mon, 1 Jan 2024 06:57:41 -0500 (EST) |
branch: externals/denote
commit 5e348d429ae70caf140bb7b33649a7e426fd1e4a
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Allow hidden files in parent directories of denote-directory
---
denote.el | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/denote.el b/denote.el
index e458a725dc..02a41d99bc 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 ()