From 8e5899d90e82ece34c930872f29330da2f4ee582 Mon Sep 17 00:00:00 2001 From: Protesilaos Stavrou Date: Sat, 18 Jun 2022 07:41:59 +0300 Subject: [PATCH] Match only files that start with ID in file search This way we avoid false positives such as the backups that Emacs creates. Also see commit ecaaa6b, which implements the same idea in another function. --- denote.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/denote.el b/denote.el index 08944f1..6e15c72 100644 --- a/denote.el +++ b/denote.el @@ -305,7 +305,8 @@ part of the list." nil (mapcar (lambda (f) - (when (and (string-match-p regexp f) + (when (and (string-match-p (concat "^" denote--id-regexp) f) + (string-match-p regexp f) (or no-check-current (not (string= (file-name-nondirectory (buffer-file-name)) f)))) f))