Skip to content

Let's put transient caches/state/files/crap in .emacs.d/.cache #40

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

Open
Fuco1 opened this issue Sep 30, 2016 · 7 comments
Open

Let's put transient caches/state/files/crap in .emacs.d/.cache #40

Fuco1 opened this issue Sep 30, 2016 · 7 comments

Comments

@Fuco1
Copy link
Collaborator

Fuco1 commented Sep 30, 2016

I've been cleaning up my config and doing some gitignore grooming and I came to the realization I had over 100 ignore rules in there :O.

Packages should put their caches and files holding state in some "centralized" directory. I propose (locate-user-emacs-file ".cache"). This is an analogy of $XDG_CACHE_HOME which points to $HOME/.cache by default (base dir spec).

It should really be enforced by emacs proper, but for now we can at least do it this way. Ideas?


This is what I end up with. Note that some directories have multiple files under them. (oh, and I autosave scratch buffers there too, I lost my data too many times now :))

@dieggsy
Copy link

dieggsy commented Nov 24, 2016

Yeah, my emacs.d is getting pretty messy and I really like this idea. How are you implementing this?

@Fuco1
Copy link
Collaborator Author

Fuco1 commented Nov 27, 2016

I did this by customizing every package separately, but the ideal state would be to "enforce" this as a rule upstream, so that package authors default to correct place automatically.

@xuchunyang
Copy link

I use https://github.com/tarsius/no-littering, it's available on Melpa.

@dieggsy
Copy link

dieggsy commented Nov 27, 2016

@xuchunyang thanks! that looks like a great solution.

@Fuco1
Copy link
Collaborator Author

Fuco1 commented Nov 27, 2016

It's good, but depends on other people submitting patches for third-party packages. Unless it gets really big it won't grab that much attention.

@dieggsy
Copy link

dieggsy commented Nov 27, 2016

@Fuco1 I think that in the end, as you say, enforcing this as a package development standard is the correct way to go about this, but until then, no-littering can provide an alternative. There's so many emacs packages that depending on PR's is probably the only sane way to do it for now, and this shouldn't be an issue - if it's a good package, we should use and promote it as well as promote contribution.

@alphapapa
Copy link

I think it would be better to use ~/.cache/emacs.d, because it's a standard place for cache files and anything that shouldn't be considered permanent. Especially, it's a standard place to exclude from backups. In contrast, ~/.emacs.d/cache won't automatically be excluded from users' backups, so it won't have the benefit of not cluttering up backups with temporary data.

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

4 participants