emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote 8a33364dc6 188/355: Add helper fn to filter file


From: ELPA Syncer
Subject: [elpa] externals/denote 8a33364dc6 188/355: Add helper fn to filter files matching regexp
Date: Sun, 26 Jun 2022 23:58:22 -0400 (EDT)

branch: externals/denote
commit 8a33364dc6f3db86dd609d5ffa4c1f8c738de0ee
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Add helper fn to filter files matching regexp
---
 denote.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/denote.el b/denote.el
index 2db4192fb9..65120ac5e2 100644
--- a/denote.el
+++ b/denote.el
@@ -312,6 +312,16 @@ With optional N, search in the Nth line from point."
        (file-directory-p file))
      (directory-files dir nil directory-files-no-dot-files-regexp t))))
 
+(defun denote--directory-files-matching-regexp (regexp)
+  "Return list of files matching REGEXP."
+  (delq
+   nil
+   (mapcar (lambda (f)
+             (when (and (string-match-p regexp f)
+                        (not (string= (file-name-nondirectory 
(buffer-file-name)) f)))
+               f))
+           (denote--directory-files))))
+
 (defun denote--keywords-in-files ()
   "Produce list of keywords in `denote--directory-files'."
   (delq nil (mapcar



reply via email to

[Prev in Thread] Current Thread [Next in Thread]