From ecaaa6bb63d43b1d0583253e0b2d530bbcebda37 Mon Sep 17 00:00:00 2001 From: Protesilaos Stavrou Date: Sat, 18 Jun 2022 07:28:18 +0300 Subject: [PATCH] Only consider items with id in directory files This way we avoid other random files that may exist in the directory, such as .dir-locals.el --- denote.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/denote.el b/denote.el index f1e7b41..08944f1 100644 --- a/denote.el +++ b/denote.el @@ -293,7 +293,8 @@ names that are relative to the variable `denote-directory'." (default-directory dir)) (seq-remove (lambda (file) - (file-directory-p file)) + (or (not (string-match-p denote--id-regexp file)) + (file-directory-p file))) (directory-files dir absolute directory-files-no-dot-files-regexp t)))) (defun denote--directory-files-matching-regexp (regexp &optional no-check-current)