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

Feature request: Smarter note housekeeping (delete notes based on 'last time read') #38

Closed
asn-d6 opened this issue Nov 28, 2016 · 2 comments

Comments

@asn-d6
Copy link

asn-d6 commented Nov 28, 2016

Hello,

I'm a big fan of deft, and through my years of use I have accumulated about 600 notes. Out of all those notes, most of them (400+) are ancient notes that I will never ever use in my life again. For example, I make quick notes all the time that I use once or twice and then they just rot there.

Having so many notes makes my deft home screen almost unuseable: it's very cluttered and also a bit slower to load.

What would be the right way to do notes housekeeping? I've been thinking that I could add a (deft-housekeeping) command that deletes notes that haven't been read in over N months. So like, if I haven't opened a note for two years, it will delete it (or ask y/n to delete it).

Do you think such a thing would be useful, or in scope for deft? Or does it exist already?
Or should this be done as an emacs hook so that it's completely third party?

If this is not possible, how would you suggest I go around implementing this? (my elisp is subpar, but I can try)

@0fiscalentropy
Copy link

0fiscalentropy commented Apr 13, 2017

If I'm not mistaken, this could be done by firstly checking the atime (date last opened) for all the files in the directory and then call deft-archive-file on the files that haven't been opened in the last N months. Don't know much elisp, so wouldn't know exactly how to implement it in Emacs, but you could use find:

find ~/.deft -type f -atime +X -delete,

where X is the number of days.

edit: not a good idea to use atime since deft access (all?) the files on startup; better to use mtime

@asn-d6
Copy link
Author

asn-d6 commented Mar 22, 2020

Thanks for the help! Closing this!

@asn-d6 asn-d6 closed this as completed Mar 22, 2020
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