-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Make it possible to rename/change the identifier #474
Comments
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 I planned on pushing some of these changes next weekend. Did you have anything specific already on this? |
In this context I would like to ask if you plan to make the date identifier more precise. Some years ago I bulk created 10.000 org-files with a script and I had to add milliseconds to the filename part that took the current date+time as identifier of the filename. Otherwise I would end up with files with the same timestamp. These are older org-files I manage in org-roam. Now that I want to migrate to denote, I run into problems as the migration skript at hand (https://github.com/bitspook/notes-migrator.git) does not support milliseconds and if I am unaware of a millisecond option in denote anyway. I may solve this issue by reimporting the files from a sqlite database where I also store the information with a wait one second function, but then the script would run for several hours. If denote had an option to evaluate a longer timestring in the filename I could just try to import them with the bitspook script or to newly export them from the database. |
You can generate 10000 timestamps programatically without waiting one second between each, like this: (defun generate-10000-dates ()
(let ((current-date (date-to-time "20240101T000000"))
(dates '()))
(dotimes (_ 10000)
(push current-date dates)
(setq current-date (time-add current-date 1)))
(nreverse dates))) Then, rename your notes to use those timestamps and you should be able to migrate them to Denote. As for the inclusion of the milliseconds in Denote, I don't think there is a plan for this. A possible improvement in the future is to allow identifiers to be any string. If that is possible, then you can have milliseconds there. But there are a few necessary adjustments to do before this is possible. |
Re: greater precision in ID datetime: funny enough, I actually have ~10k files (and gradually growing) named with nanosecond precision (the names are just an ISO8601-conformant timestamp with extended precision: f.e. I currently just treat those as non-Denoted names, and I never need to manually manipulate those files, but I sometimes think about generalizing my wrappers/reimplementations of Denote pieces to tolerate/accept an optional Not recommending/asking that you support that, just mentioning another unexpected in-the-wild use-case that Denoted naming (and UI improvements based on it) elegantly covers (once broadened/generalized just a tiny amount). |
re: milliseconds again: I just remembered, my earlier idea to make ID regex user-configurable would also enable users who want higher-precision datetimes as IDs. |
@mentalisttraceur, I don't know yet how we can support identifiers with milliseconds, but I am curious: do you know a function that converts a string with nanoseconds ("20240101T000000,123456789Z") to a Lisp timestamp? Denote uses |
@jeanphilippegg, That said, I was only imagining bare minimum support of alternate IDs - configurable recognition for linking/fontification/etc purposes, but no automatic generation/incrementation. So you would never need to parse them, they'd just be opaque strings. |
Oh,
|
That is good to know! I don't know how this could be used in Denote. |
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.The text was updated successfully, but these errors were encountered: