[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 0cddca8735 4/7: Remove no-check-current paramete
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 0cddca8735 4/7: Remove no-check-current parameter from denote--directory-files-matching-regexp |
Date: |
Mon, 18 Jul 2022 01:57:40 -0400 (EDT) |
branch: externals/denote
commit 0cddca87356723ea0b9fc2656c2303003a8b1866
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Remove no-check-current parameter from
denote--directory-files-matching-regexp
---
denote.el | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/denote.el b/denote.el
index c87f5aa141..864f6d2a96 100644
--- a/denote.el
+++ b/denote.el
@@ -445,18 +445,15 @@ names that are relative to the variable
`denote-directory'."
(string-prefix-p id (file-name-nondirectory f)))
(denote--directory-files :absolute)))
-(defun denote--directory-files-matching-regexp (regexp &optional
no-check-current)
- "Return list of files matching REGEXP.
-With optional NO-CHECK-CURRENT do not test if the current file is
-part of the list."
+(defun denote--directory-files-matching-regexp (regexp)
+ "Return list of files matching REGEXP."
(delq
nil
(mapcar
(lambda (f)
(when (and (denote--only-note-p f)
(string-match-p regexp f)
- (or no-check-current
- (not (string= (file-name-nondirectory (buffer-file-name))
f))))
+ (not (string= (file-name-nondirectory (buffer-file-name)) f)))
f))
(denote--directory-files))))
@@ -841,19 +838,20 @@ is set to \\'(file-type title keywords)."
;; This should only be relevant for `denote-date', otherwise the
;; identifier is always unique (we trust that no-one writes multiple
;; notes within fractions of a second).
-(defun denote--id-exists-p (identifier no-check-current)
- "Return non-nil if IDENTIFIER already exists.
-NO-CHECK-CURRENT passes the appropriate flag to
-`denote--directory-files-matching-regexp'."
- (or (cl-some (lambda (file)
- (string-match-p (concat "\\`" identifier) file))
- (denote--buffer-file-names))
- (denote--directory-files-matching-regexp
- (concat "\\`" identifier) no-check-current)))
+(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 (cl-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))))))
(defun denote--barf-duplicate-id (identifier)
"Throw a user-error if IDENTIFIER already exists else return t."
- (if (denote--id-exists-p identifier :no-check-current)
+ (if (denote--id-exists-p identifier)
(user-error "`%s' already exists; aborting new note creation" identifier)
t))
- [elpa] externals/denote updated (c9a01a3718 -> 680dbdf6b2), ELPA Syncer, 2022/07/18
- [elpa] externals/denote 0cddca8735 4/7: Remove no-check-current parameter from denote--directory-files-matching-regexp,
ELPA Syncer <=
- [elpa] externals/denote 6438bc7965 3/7: Check buffer file names in denote--id-exists-p, ELPA Syncer, 2022/07/18
- [elpa] externals/denote 1d89fa0d33 2/7: Use string-prefix-p in denote--dir-in-denote-directory-p, ELPA Syncer, 2022/07/18
- [elpa] externals/denote c5bba5fef1 5/7: Fix denote with subdirectories, ELPA Syncer, 2022/07/18
- [elpa] externals/denote a80ffc1425 1/7: Rework denote--prepare-note, ELPA Syncer, 2022/07/18
- [elpa] externals/denote 680dbdf6b2 7/7: Merge pull request #55 from jeanphilippegg/denote--prepare-notes, ELPA Syncer, 2022/07/18
- [elpa] externals/denote f4fae528c3 6/7: Return only Denote files in denote--buffer-file-names, ELPA Syncer, 2022/07/18