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)
This commit is contained in:
Jean-Charles Bagneris 2023-07-22 11:29:46 +00:00 committed by Protesilaos Stavrou
parent 7702d37efd
commit 99c5db01e3
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -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)