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

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

[elpa] externals/denote 564c139c78 04/14: Rework denote-faces-file-name-


From: ELPA Syncer
Subject: [elpa] externals/denote 564c139c78 04/14: Rework denote-faces-file-name-keywords
Date: Sat, 9 Jul 2022 02:57:36 -0400 (EDT)

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

    Rework denote-faces-file-name-keywords
    
    Remove denote--file-tile-regexp and denote--file-regexp
---
 denote-faces.el | 17 ++++++++++-------
 denote.el       | 11 +++--------
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/denote-faces.el b/denote-faces.el
index d19c913b1c..a0761473e5 100644
--- a/denote-faces.el
+++ b/denote-faces.el
@@ -83,14 +83,17 @@ and seconds."
   :group 'denote-faces)
 
 (defconst denote-faces-file-name-keywords
-  `((,denote--file-regexp
+  `((,denote--id-regexp
      (1 'denote-faces-date)
-     (2 'denote-faces-time)
-     (3 'denote-faces-delimiter)
-     (4 'denote-faces-title)
-     (5 'denote-faces-delimiter)
-     (6 'denote-faces-keywords)
-     (7 'denote-faces-extension))
+     (2 'denote-faces-time))
+    (,denote--title-regexp
+     (1 'denote-faces-title))
+    (,denote--keywords-regexp
+     (1 'denote-faces-keywords))
+    (,denote--extension-regexp
+     (0 'denote-faces-extension))
+    ("--"
+     (0 'denote-faces-delimiter t))
     ("_"
      (0 'denote-faces-delimiter t)))
   "Keywords for fontification of file names.")
diff --git a/denote.el b/denote.el
index dd9e484469..340ae55df0 100644
--- a/denote.el
+++ b/denote.el
@@ -239,20 +239,15 @@ are described in the doc string of `format-time-string'."
 (defconst denote--id-regexp "\\([0-9]\\{8\\}\\)\\(T[0-9]\\{6\\}\\)"
   "Regular expression to match `denote--id-format'.")
 
+(defconst denote--title-regexp "--\\([0-9A-Za-z-]*\\)"
+  "Regular expression to match keywords.")
+
 (defconst denote--keywords-regexp "__\\([0-9A-Za-z_-]*\\)"
   "Regular expression to match keywords.")
 
 (defconst denote--extension-regexp "\\.\\(org\\|md\\|txt\\)"
   "Regular expression to match supported Denote extensions.")
 
-(defconst denote--file-title-regexp
-  (concat denote--id-regexp "\\(--\\)\\(.*\\)\\(__\\)")
-  "Regular expression to match file names from `denote'.")
-
-(defconst denote--file-regexp
-  (concat denote--file-title-regexp "\\([0-9A-Za-z_-]*\\)\\(\\.?.*\\)")
-  "Regular expression to match the entire file name'.")
-
 (defconst denote--punctuation-regexp "[][{}!@#$%^&*()_=+'\"?,.\|;:~`‘’“”/]*"
   "Regular expression of punctionation that should be removed.
 We consider those characters illigal for our purposes.")



reply via email to

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