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

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

[elpa] externals/denote 8a25727777 03/11: Remove check of current buffer


From: ELPA Syncer
Subject: [elpa] externals/denote 8a25727777 03/11: Remove check of current buffer in denote--id-exists-p
Date: Mon, 8 Aug 2022 23:57:31 -0400 (EDT)

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

    Remove check of current buffer in denote--id-exists-p
---
 denote.el | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/denote.el b/denote.el
index 297330d9e4..98fb9ebd0e 100644
--- a/denote.el
+++ b/denote.el
@@ -894,14 +894,11 @@ 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."
-  (let ((current-buffer-name (when (buffer-file-name)
-                               (file-name-nondirectory (buffer-file-name)))))
-    (or (seq-some (lambda (file)
-                    (string-match-p (concat "\\`" identifier) file))
-                  (delete current-buffer-name (denote--buffer-file-names)))
-        (delete current-buffer-name
-                (denote--directory-files-matching-regexp
-                 (concat "\\`" identifier))))))
+  (or (seq-some (lambda (file)
+                  (string-match-p (concat "\\`" identifier) file))
+                (denote--buffer-file-names))
+      (denote--directory-files-matching-regexp
+       (concat "\\`" identifier))))
 
 (defun denote--barf-duplicate-id (identifier)
   "Throw a user-error if IDENTIFIER already exists."
@@ -2002,7 +1999,7 @@ inserts links with just the identifier."
     (read-regexp "Insert links matching REGEX: " nil 
'denote-link--add-links-history)
     current-prefix-arg))
   (let ((current-file (buffer-file-name)))
-    (if-let ((files (denote--directory-files-matching-regexp regexp)))
+    (if-let ((files (delete current-file 
(denote--directory-files-matching-regexp regexp))))
         (let ((beg (point)))
           (insert (denote-link--prepare-links files current-file id-only))
           (unless (derived-mode-p 'org-mode)



reply via email to

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