protesilaos / denote

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

Make it possible to rename/change the identifier #474

Open protesilaos opened 2 weeks ago

protesilaos commented 2 weeks ago

We have mentioned the titular idea before and we have the building blocks to make it happen. Modifying the identifier can be problematic, because it may result in duplicates (we have code to avoid this inside of the denote-directory, but it can still happen if the user renames files elsewhere and then consolidates them in a single directory). If there are such cases, we have to trust the user to resolve them or, maybe, we can provide a command that does that automatically.

I think this is the right time to provide the relevant points of entry. @jeanphilippegg You recently made changes to the denote-files-types. Are you also planning something along those lines? If yes, then I will wait for it. Otherwise, I will go ahead with some code and then we can iterate on it.

jeanphilippegg commented 2 weeks ago

Actually, yes!

I had the following 2 changes in mind before that:

After the above changes, I would have worked on allowing the modification of the identifier (under the condition that there are no links to the note) and maybe allow its absence. I want to make this possible using what we already have for other components. Changing the date with denote-rename-file should just change the date/id as expected (it does nothing right now). I would not add any new commands specific to date/id, except maybe the convenience denote-rename-file-date!

I planned on pushing some of these changes next weekend.

Did you have anything specific already on this?