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

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

[elpa] externals/denote e1c45e25f4 219/355: Optionally no current in fil


From: ELPA Syncer
Subject: [elpa] externals/denote e1c45e25f4 219/355: Optionally no current in files in dir regexp match
Date: Sun, 26 Jun 2022 23:58:26 -0400 (EDT)

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

    Optionally no current in files in dir regexp match
---
 denote.el | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/denote.el b/denote.el
index a4e4ef9fbe..35447baccb 100644
--- a/denote.el
+++ b/denote.el
@@ -291,15 +291,19 @@ names that are relative to the variable 
`denote-directory'."
        (file-directory-p file))
      (directory-files dir absolute directory-files-no-dot-files-regexp t))))
 
-(defun denote--directory-files-matching-regexp (regexp)
-  "Return list of files matching REGEXP."
+(defun denote--directory-files-matching-regexp (regexp &optional 
no-check-current)
+  "Return list of files matching REGEXP.
+With optional NO-CHECK-CURRENT do not test if the current file is
+part of the list."
   (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))))
+   (mapcar
+    (lambda (f)
+      (when (and (string-match-p regexp f)
+                 (or no-check-current
+                     (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'."



reply via email to

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