[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote dcf8739474 261/355: Improve valid note test (rev
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote dcf8739474 261/355: Improve valid note test (revise ecaaa6b, 8e5899d) |
Date: |
Sun, 26 Jun 2022 23:58:31 -0400 (EDT) |
branch: externals/denote
commit dcf87394741f8713b943035def4cd55a1151f456
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Improve valid note test (revise ecaaa6b, 8e5899d)
---
denote.el | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/denote.el b/denote.el
index 6e15c726e5..cb10570415 100644
--- a/denote.el
+++ b/denote.el
@@ -283,6 +283,14 @@ trailing hyphen."
"Return non-nil if FILE is empty."
(zerop (or (file-attribute-size (file-attributes file)) 0)))
+(defun denote--only-note-p (file)
+ "Make sure FILE is an actual Denote note.
+FILE is relative to the variable `denote-directory'."
+ (and (not (file-directory-p file))
+ (file-regular-p file)
+ (string-match-p (concat "^" denote--id-regexp) file)
+ (not (string-match-p "~\\'" file))))
+
;;;; Keywords
(defun denote--directory-files (&optional absolute)
@@ -292,9 +300,8 @@ names that are relative to the variable `denote-directory'."
(let* ((dir (denote-directory))
(default-directory dir))
(seq-remove
- (lambda (file)
- (or (not (string-match-p denote--id-regexp file))
- (file-directory-p file)))
+ (lambda (f)
+ (not (denote--only-note-p f)))
(directory-files dir absolute directory-files-no-dot-files-regexp t))))
(defun denote--directory-files-matching-regexp (regexp &optional
no-check-current)
@@ -305,7 +312,7 @@ part of the list."
nil
(mapcar
(lambda (f)
- (when (and (string-match-p (concat "^" denote--id-regexp) 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))))
- [elpa] externals/denote 5c400d80d9 191/355: Document regexp example for file extension, (continued)
- [elpa] externals/denote 5c400d80d9 191/355: Document regexp example for file extension, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 8a33364dc6 188/355: Add helper fn to filter files matching regexp, ELPA Syncer, 2022/06/27
- [elpa] externals/denote f2cfcd26ea 205/355: Refine denote-retrieve regular expressions, ELPA Syncer, 2022/06/27
- [elpa] externals/denote d46c8fec55 239/355: Add "Contributing" section to the manual, ELPA Syncer, 2022/06/27
- [elpa] externals/denote bcbd52a784 200/355: Use format specifiers for denote-link-add-links, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 443c687f05 248/355: Update denote-dired--edit-front-matter-p docstring, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 9b9a764e57 230/355: Fix typo about package name, ELPA Syncer, 2022/06/27
- [elpa] externals/denote d09249d48f 253/355: Make 'default-directory' safe for denote-directory, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 737c647957 246/355: Rename buffer post file rename, ELPA Syncer, 2022/06/27
- [elpa] externals/denote d0584c0e15 271/355: Refine denote--only-note-p conditions, ELPA Syncer, 2022/06/27
- [elpa] externals/denote dcf8739474 261/355: Improve valid note test (revise ecaaa6b, 8e5899d),
ELPA Syncer <=
- [elpa] externals/denote 83d53afae4 245/355: Improve dired revert-buffer post rename, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 8e5899d90e 260/355: Match only files that start with ID in file search, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 341cd28b5a 266/355: Fix bug with 'default-directory' reset, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 0f149afba2 264/355: Simplify how temp buffer contents are returned, ELPA Syncer, 2022/06/27
- [elpa] externals/denote d8ef0a0c7c 282/355: EXPERIMENTAL Add buttonization for all links, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 843fb30dff 301/355: Answer FAQ about sorting files, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 47a9024b00 252/355: BREAKING update the .dir-locals.el sample, ELPA Syncer, 2022/06/27
- [elpa] externals/denote bd14f8a813 293/355: REMOVE denote-link-register-ol-hyperlink variable, ELPA Syncer, 2022/06/27
- [elpa] externals/denote a611e08ec1 285/355: Clarify that linking still needs some updates, ELPA Syncer, 2022/06/27
- [elpa] externals/denote c3feb9a0ec 250/355: Remove superfluous when, ELPA Syncer, 2022/06/27