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

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

[elpa] externals/denote 2aaf0f56d1 05/27: Add regexp to match only note


From: ELPA Syncer
Subject: [elpa] externals/denote 2aaf0f56d1 05/27: Add regexp to match only note file names
Date: Sun, 3 Jul 2022 00:57:34 -0400 (EDT)

branch: externals/denote
commit 2aaf0f56d1bb415c9ba2fa9dc0bae705ac34df02
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Add regexp to match only note file names
---
 denote.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index c31b673c58..9c4abb2f55 100644
--- a/denote.el
+++ b/denote.el
@@ -227,6 +227,10 @@ is suspended: we use whatever the user wants."
   (concat denote--file-title-regexp "\\([0-9A-Za-z_-]*\\)\\(\\.?.*\\)")
   "Regular expression to match the entire file name'.")
 
+(defconst denote--file-only-note-regexp
+  (concat denote--file-regexp "\\.\\(org\\|md\\|txt\\)")
+  "Regular expression to match the entire file name of a note file.")
+
 (defconst denote--punctuation-regexp "[][{}!@#$%^&*()_=+'\"?,.\|;:~`‘’“”/]*"
   "Regular expression of punctionation that should be removed.
 We consider those characters illigal for our purposes.")
@@ -307,7 +311,7 @@ trailing hyphen."
 FILE is relative to the variable `denote-directory'."
   (and (not (file-directory-p file))
        (file-regular-p file)
-       (string-match-p (concat "\\b" denote--id-regexp) file)
+       (string-match-p denote--file-only-note-regexp file)
        (not (string-match-p "[#~]\\'" file))))
 
 (defun denote--file-name-relative-to-denote-directory (file)



reply via email to

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