[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 99c5db01e3 1/2: Treat "T" of identifier as a del
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 99c5db01e3 1/2: Treat "T" of identifier as a delimiter in Denote file fontification |
Date: |
Tue, 1 Aug 2023 00:57:52 -0400 (EDT) |
branch: externals/denote
commit 99c5db01e3f556debdf278bb7fb92753de1c9143
Author: Jean-Charles Bagneris <lists@bagneris.net>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Treat "T" of identifier as a delimiter in Denote file fontification
The idea was to make things as simple and unobtrusive as possible,
thus I simply treated the "T" separator in the timestamp as a
delimiter. The effect is noticed in 'denote-dired-mode' and the
default backlinks buffer.
The introduction of a new face, 'denote-faces-time-delimiter', makes
it possible for users to revert to the previous style where the "T"
looks the same as the rest of the identifier. Evaluate this:
(set-face-attribute 'denote-faces-time-delimiter nil :inherit
'denote-faces-date)
---
denote.el | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/denote.el b/denote.el
index 322eade3a2..c084059075 100644
--- a/denote.el
+++ b/denote.el
@@ -2655,9 +2655,14 @@ and seconds."
:group 'denote-faces
:package-version '(denote . "0.1.0"))
+(defface denote-faces-time-delimiter '((t :inherit shadow))
+ "Face for the delimiter between date and time in Dired buffers."
+ :group 'denote-faces
+ :package-version '(denote . "2.1.0"))
+
;; For character classes, evaluate: (info "(elisp) Char Classes")
(defvar denote-faces--file-name-regexp
- (concat "\\(?1:[0-9]\\{8\\}\\)\\(?2:T[0-9]\\{6\\}\\)"
+ (concat "\\(?1:[0-9]\\{8\\}\\)\\(?10:T\\)\\(?2:[0-9]\\{6\\}\\)"
"\\(?:\\(?3:==\\)\\(?4:[[:alnum:][:nonascii:]=]*?\\)\\)?"
"\\(?:\\(?5:--\\)\\(?6:[[:alnum:][:nonascii:]-]*?\\)\\)?"
"\\(?:\\(?7:__\\)\\(?8:[[:alnum:][:nonascii:]_-]*?\\)\\)?"
@@ -2667,6 +2672,7 @@ and seconds."
(defconst denote-faces-file-name-keywords
`((,(concat "[\t\s]+" denote-faces--file-name-regexp)
(1 'denote-faces-date)
+ (10 'denote-faces-time-delimiter nil t)
(2 'denote-faces-time)
(3 'denote-faces-delimiter nil t)
(4 'denote-faces-signature nil t)
@@ -2678,9 +2684,10 @@ and seconds."
"Keywords for fontification of file names.")
(defconst denote-faces-file-name-keywords-for-backlinks
- `((,(concat "^\\(?10:.*/\\)?" denote-faces--file-name-regexp)
- (10 'denote-faces-subdirectory nil t)
+ `((,(concat "^\\(?11:.*/\\)?" denote-faces--file-name-regexp)
+ (11 'denote-faces-subdirectory nil t)
(1 'denote-faces-date)
+ (10 'denote-faces-time-delimiter nil t)
(2 'denote-faces-time)
(3 'denote-faces-delimiter nil t)
(4 'denote-faces-signature nil t)