Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate faces for year, month, day, hour, minute, and second in dired fontification please #276

Closed
mentalisttraceur opened this issue Mar 7, 2024 · 3 comments

Comments

@mentalisttraceur
Copy link

mentalisttraceur commented Mar 7, 2024

I'm thinking, basically:

  1. Keep denote-faces-date and denote-faces-time, for backwards compatibility. The new faces will inherit from them, so nothing will change for anyone by default.

  2. Add denote-faces-year, denote-faces-month, denote-faces-day (inherit from denote-faces-date) denote-faces-hour, denote-faces-minute, and denote-faces-second (inherit from denote-faces-time).

  3. Split "\\(?1:[0-9]\\{8\\}\\)\\(?10:T\\)\\(?2:[0-9]\\{6\\}\\)" into

    "\\(?1:[0-9]\\{4\\}\\)\\(?12:[0-9]\\{2\\}\\)\\(?13:[0-9]\\{2\\}\\)"
    "\\(?10:T\\)"
    "\\(?2:[0-9]\\{2\\}\\)\\(?14:[0-9]\\{2\\}\\)\\(?15:[0-9]\\{2\\}\\)"

    (Personally I would renumber the groups but I just incremented from what was already there.)

Then users who want to boost visual parsing of the date and time can find and configure the faces individually.

@mentalisttraceur
Copy link
Author

mentalisttraceur commented Mar 7, 2024

Three big examples where it's really nice to clearly see the datetime when looking at the file names:

  1. Pictures, videos. I'm gradually migrating all such files to Denote-style naming. When looking through those in a Dired, the date and time are often relevant/useful.

  2. Legal documents and other records. For example, a signed apartment lease could be given its signature date or expiration date as the Denote ID, precisely to make that information visually accessible from just the file name. (In fact the mere lexical sorting on file name can become a nice crude calendar of either when you received something or when you need to do something about it.)

  3. Tasks and events! I have a basic task system built out of Denote+Dired. Each task is a Denote file. A task list is a keyword-filtered Dired buffer. If the task is "scheduled", like an appointment, the Denote ID is that time.

protesilaos added a commit that referenced this issue Mar 11, 2024
Thanks to mentalisttraceur for suggesting the idea in issue 276:
<#276>.
@protesilaos
Copy link
Owner

Done, thank you!

Quick sample with the modus-themes:

(defun my-modus-themes-denote-faces (&rest _)
  (modus-themes-with-colors
    (custom-set-faces
     `(denote-faces-year ((,c :foreground ,cyan)))
     `(denote-faces-month ((,c :foreground ,magenta-warmer)))
     `(denote-faces-day ((,c :foreground ,cyan)))
     `(denote-faces-time-delimiter ((,c :foreground ,fg-main)))
     `(denote-faces-hour ((,c :foreground ,magenta-warmer)))
     `(denote-faces-minute ((,c :foreground ,cyan)))
     `(denote-faces-second ((,c :foreground ,magenta-warmer))))))

(add-hook 'modus-themes-post-load-hook #'my-modus-themes-denote-faces)

Screenshot from 2024-03-11 10-56-15

@mentalisttraceur
Copy link
Author

Nice, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants