treemacs icon indicating copy to clipboard operation
treemacs copied to clipboard

Don't use a directory named "cache" to store persistent data by default

Open TLATER opened this issue 6 years ago • 15 comments

I know that the directory in which the projects are stored is configurable, but calling something that's expected to be persistent "cache" is asking for accidental deletions.

As far as I can tell it's commonplace to just create a directory named $HOME/.emacs.d/<project_name>, why not just store data in $HOME/.emacs.d/treemacs? Or if you want to introduce a standard for storing persistent data, maybe use $HOME/.emacs.d/.share/treemacs/ to stay consistent with normal unix path names/XDG standards?

TLATER avatar May 04 '19 22:05 TLATER

Blame spacemacs, it's their convention I had followed.

Now I do get where you're coming from, but unless there's people actually deleting their stuff out there I'd rather put this on the back burner - whatever migration would have to be non-trivial to keep the previous config intact.

Alexander-Miller avatar May 06 '19 19:05 Alexander-Miller

treemacs-persist is a useful file. I keep it under version control.

So I have customised the value using the customise interface and the value is in my custom.el which is read before treemacs is loaded with use-package. However treemacs loads from the .cache directory first. It saves it to the customised place correctly but then never reads it (I have many backups of it all the same - isn't usual emacs practice to only save if changed)

I would also note the crash file is hard coded to be in .cache (a defconst no less)

cache files are there to be blown away without thinking for any test or debugging issue.

bestlem avatar May 25 '19 20:05 bestlem

However treemacs loads from the .cache directory first

Are you on spacemacs, or have otherwise customized your custom-file? Try putting a (load custom-file) in your config.

I would also note the crash file is hard coded to be in .cache (a defconst no less)

The const in defconst is just for decoration (and declaring your intention), so you can change it if necessary. However you're right that it should be put in the same directory as the persist file.

Alexander-Miller avatar May 26 '19 10:05 Alexander-Miller

No on Aquamacs and changed and loaded my custom file back to a more normal place before treemacs use-package is called.

bestlem avatar May 28 '19 12:05 bestlem

So let's make sure that your custom-file is read. Put (error "CUSTOM FILE") at the top, restart emacs and then see if the error is thrown or not.

Alexander-Miller avatar May 28 '19 17:05 Alexander-Miller

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 07 '21 18:10 stale[bot]

I'm still consistently annoyed by projects using this convention, so it still matters to me, hopefully eventually there will be enough drive to fix this across the ecosystem.

TLATER avatar Oct 08 '21 10:10 TLATER

This issue is to stay open, yes.

Alexander-Miller avatar Oct 09 '21 10:10 Alexander-Miller

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 08 '21 10:12 stale[bot]

Stayin alive.

Alexander-Miller avatar Dec 25 '21 15:12 Alexander-Miller

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 23 '22 15:02 stale[bot]

Stayin alive.

Alexander-Miller avatar Feb 23 '22 18:02 Alexander-Miller

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 24 '22 18:04 stale[bot]

Stayin alive.

Alexander-Miller avatar Apr 25 '22 10:04 Alexander-Miller

This issue has been automatically marked as stale because it has not had recent activity.

stale[bot] avatar Jun 24 '22 12:06 stale[bot]