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

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

[elpa] externals/denote 2d12ec7457 05/11: Refactor denote--id-exists-p


From: ELPA Syncer
Subject: [elpa] externals/denote 2d12ec7457 05/11: Refactor denote--id-exists-p
Date: Mon, 8 Aug 2022 23:57:31 -0400 (EDT)

branch: externals/denote
commit 2d12ec7457d03c4fe8ba67e2d37f73fbf350e606
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>

    Refactor denote--id-exists-p
---
 denote.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/denote.el b/denote.el
index 6e8b7552f0..df37644b2c 100644
--- a/denote.el
+++ b/denote.el
@@ -895,11 +895,10 @@ where the former does not read dates without a time 
component."
 ;; notes within fractions of a second).
 (defun denote--id-exists-p (identifier)
   "Return non-nil if IDENTIFIER already exists."
-  (or (seq-some (lambda (file)
-                  (string-match-p (concat "\\`" identifier) file))
-                (denote--buffer-file-names))
-      (denote--directory-files-matching-regexp
-       (concat "\\`" identifier))))
+  (seq-some (lambda (file)
+              (string-prefix-p identifier (file-name-nondirectory file)))
+            (concat (denote--directory-files :absolute)
+                    (denote--buffer-file-names))))
 
 (defun denote--barf-duplicate-id (identifier)
   "Throw a user-error if IDENTIFIER already exists."



reply via email to

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