protesilaos / denote

Simple notes for Emacs with an efficient file-naming scheme
https://protesilaos.com/emacs/denote
GNU General Public License v3.0
455 stars 49 forks source link

Rework the fontification #359

Closed jeanphilippegg closed 1 month ago

jeanphilippegg commented 1 month ago

This is a proposition for a new fontification. It works with our current file names, but it also supports the future file names that can have permuted file name components. It works in Dired and the backlinks buffer.

For now, titles always need to be prefixed with their delimiter (--) even if they are the first component. I prefer keeping options open for now.

Also the code for the various matchers are all similar. I prefered keeping them separate for now, even if it meant some code duplication.

You can give it a try!

Whenever we are ready and satisfied with the result, we can merge it, even if we don't have the code for the permutation of file name components yet.

Here is an image of the results:

fontification

protesilaos commented 1 month ago

Merged, thank you!

Whenever we are ready and satisfied with the result, we can merge it, even if we don't have the code for the permutation of file name components yet.

I wonder what is your idea for the first field in this scenario. What you show in the picture above preserves the field separator, though this is not consistent with how we do it with the identifier. Maybe the plan is to have those without the separator? Of course, we do not need to discuss this here and now. Just mentioning it because I noticed it now.

jeanphilippegg commented 1 month ago

The idea for now is to always keep the delimiter, except only for the identifier which can drop its delimiter. The reason is that in a file named "some-word@@id.org", what is "some-word"? Is it a title? A keyword? A signature perhaps?

We could arguably drop the delimiter for only one component (the title probably would be best), but we cannot for all components. That is what I meant above when I said that I wanted to keep options open for now. Let's keep the delimiter for all components and we may choose which one is allowed to drop it later (if we go this way).

protesilaos commented 1 month ago

From: Jean-Philippe Gagné Guay @.***> Date: Sat, 18 May 2024 10:33:31 -0700

The idea for now is to always keep the delimiter, except only for the identifier which can drop its delimiter. The reason is that in a file named "some-word@@id.org", what is "some-word"? Is it a title? A keyword? A signature perhaps?

We could arguably drop the delimiter for only one component (the title probably would be best), but we cannot for all components. That is what I meant above when I said that I wanted to keep options open for now. Let's keep the delimiter for all components and we may choose which one is allowed to drop it later (if we go this way).

It would indeed be ambiguous. Keeping the delimiter is fine in this case.

-- Protesilaos Stavrou https://protesilaos.com