~protesilaos/denote

proposed change to improve timestamp readability in denote file names v1 APPLIED

Protesilaos Stavrou: 1
 proposed change to improve timestamp readability in denote file names

 1 files changed, 10 insertions(+), 3 deletions(-)
Jean-Charles Bagneris <lists@bagneris.net>
Excellent, the possibility to revert back easily to the previous look and feel
would obviously be nice to some users.
Next
Jean-Charles Bagneris <lists@bagneris.net>
Hello Prot,
Next
Jean-Charles Bagneris <lists@bagneris.net>
Shouldn't this line above use 'denote-faces-time-delimiter as well?

Have a nice day
Next
Hello Jean-Charles,
Next
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~protesilaos/denote/patches/43072/mbox | git am -3
Learn more about email & git

Re: [PATCH] proposed change to improve timestamp readability in denote file names Export this patch

Hello again Jean-Charles and sorry for being slow to respond!
> From: "Jean-Charles Bagneris" <lists@bagneris.net>
> Date: Sun, 23 Jul 2023 13:49:33 +0000

> [... 17 lines elided]

>> Personally, I find the current delimiter colour too subtle for the "T".
>> Perhaps because I am used to its previous style.  I think using the
>> 'shadow' face follows the spirit of your change while using a subtle
>> colour that is (hopefully) consistent with the underlying theme.
>>
>> What do you think?
>
> I actually felt the same (colour too subtle) but chose to introduce the change
> with a minimal patch before investigating further. Using the 'shadow' face 
> seems to be a good tradeoff, no problem for me.
>
> Thank you for the feedback, and congrats for 2.0!

I have tweaked your patch based on this discussion.  I want to install
the following changes on your behalf (I will mention you in the manual
as well).  Please check them and let me know if everything is okay:

From a279e1cf1a11bb913d503d717daca060987668e5 Mon Sep 17 00:00:00 2001
Message-ID: <a279e1cf1a11bb913d503d717daca060987668e5.1690604032.git.info@protesilaos.com>
From: Jean-Charles Bagneris <lists@bagneris.net>
Date: Sat, 22 Jul 2023 11:29:46 +0000
Subject: [PATCH] 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 322eade..804f9c5 100644
--- a/denote.el
+++ b/denote.el
@@ -2655,9 +2655,14 @@ (defface denote-faces-delimiter
  :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 @@ (defvar denote-faces--file-name-regexp
(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 @@ (defconst denote-faces-file-name-keywords
  "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-delimiter nil t)
     (2 'denote-faces-time)
     (3 'denote-faces-delimiter nil t)
     (4 'denote-faces-signature nil t)
-- 
2.41.0


All the best,
Prot

-- 
Protesilaos Stavrou
https://protesilaos.com
Jean-Charles Bagneris <lists@bagneris.net>
Hello Prot,
Jean-Charles Bagneris <lists@bagneris.net>
Shouldn't this line above use 'denote-faces-time-delimiter as well?

Have a nice day