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.
This commit is contained in:
Protesilaos Stavrou 2022-06-18 07:41:59 +03:00
parent ecaaa6bb63
commit 8e5899d90e
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -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))