Link to previous chronological note #644
Replies: 1 comment 1 reply
-
|
In Denote, the file identifier is also the date of creation. This means you can generate a list of your notes and then sort by identifier, and that will be the same as sorting by date. A combination of So, this returns the last note with the keyword ;; (car (last ...)) gets the last element of a list
(car (last
(denote-sort-files
(denote-directory-files "_emacs" :omit-current)
'identifier)))This works even if you changed the order of components and/or use multiple directories, but not if you changed default identifier format. You said you want to link to a previous note that shares the same keywords as current one. You can extract the keywords for current note with: (denote-extract-keywords-from-path buffer-file-name)You can create a link with the following code (you need to fill FILE with the actual file you want to link to). (denote-link FILE (denote-filetype-heuristics buffer-file-name) (denote-get-link-description FILE))If you want to craft the function yourself, this is enough to do so; you just need a little bit of Elisp to glue it together. Otherwise, feel free to ask and we'll create something for you! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m thinking about adding a feature for my notes — I want to be able to link to the previous note that shares the same keywords. Are there any functions that could make that easier to do?
Beta Was this translation helpful? Give feedback.
All reactions