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

* core-load-paths.el: New spacemacs-state-directory to store user state files #16759

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

sunlin7
Copy link
Contributor

@sunlin7 sunlin7 commented Dec 27, 2024

To fix #7818, a new variable spacemacs-state-directory is introduced.

NOTE:
It's part of work on XDG_* directories supports. #3589.
It's pre-work for #16706.

…ate files

Support initializing the spacemacs-cache-directory from environment
variable SPACEMACSCACHE or XDG_CACHE_HOME.
@sunlin7 sunlin7 force-pushed the spacemacs-state-dir branch from c5606b4 to 64ea406 Compare December 27, 2024 07:17
@fnussbaum fnussbaum self-requested a review December 27, 2024 14:03
@fnussbaum fnussbaum marked this pull request as draft December 28, 2024 00:40
@fnussbaum fnussbaum changed the title * core-load-paths.el: New spacemacs-state-directory to strore user state files * core-load-paths.el: New spacemacs-state-directory to store user state files Dec 30, 2024
@fnussbaum
Copy link
Collaborator

This PR may be a candidate where it would make sense to postpone the merge until after we release a new stable version, see #16775.

My current plan (open to suggestions) is to use a directory scheme that is compatible with the no-littering package (and with XDG in a broad sense, though no-littering does not use a cache directory), and add a user option (disabled by default) to use no-littering. By default, the old directories should probably be used, as users will likely have to manually/semi-automatically migrate their files to the new directories.

The following table contains most instances of files that are currently put into the cache directory. The second column specifies where they would end up with the current state of this PR (subject to change), and the third column is where no-littering would put them. The no-littering package uses two customizable locations: etc, and var. The etc directory could be something like dotspacemacs-directory/etc/, and var could be spacemacs-state-directory, for example.

PR no-littering
spacemacs-version--last-startup-check-file state -
spacemacs-revision--file state -
spacemacs--last-emacs-version-file state -
bm-repository-file state var
tramp-persistency-file-name state var
bookmark-default-file state var
recentf-save-file state var
savehist-file state var
save-place-file state var
desktop-dirname state var
added to list: desktop-path state var (*)
projectile-known-projects-file state var
persistent-scratch-save-file state var
configuration-layer--last-dotspacemacs-configuration-layers-file cache -
configuration-layer-stable-elpa-directory cache -
configuration-layer--rollback-root-directory cache -
quelpa-dir cache -
spacemacs-buffer--cache-file cache -
spacemacs-auto-save-directory cache -
spacemacs-dump-directory cache -
spacemacs--custom-file cache -
transient-history-file cache var
transient-levels-file cache etc
forge-database-file cache var
srecode-map-save-file cache var
semanticdb-default-save-directory cache var
pyim-directory cache -
youdao-dictionary-search-history-file cache -
spacemacs-games-cache-directory cache -
emojify-emojis-dir cache var
xkcd-cache-dir cache var
smex-save-file cache var
org-clock-persist-file cache var
org-id-locations-file cache var
org-publish-timestamp-directory cache var
lsp-server-install-dir cache var
image-dired-dir cache var
twitter-images-directory cache -
pandoc-data-dir cache etc
eshell-directory-name cache var
eshell-z-freq-dir-hash-table-file-name cache -
ac-comphist-file cache var
company-statistics-file cache var
erc-log-channels-directory cache var
erc-image-images-path cache -
erc-tweet-cache-dir cache -
erc-yt-cache-dir cache -
rcirc-log-directory cache var
spacemacs-layouts-directory cache -
projectile-cache-file cache var
ido-save-directory-list-file cache var
request-storage-directory cache var
undo-tree-history-directory-alist cache (var)
undo-fu-session-directory cache var
open-junk-file-format cache -
abbrev-file-name cache etc
add to list: recentf-exclude cache -
url-configuration-directory cache var
evil-tutor-working-directory cache -
anaconda-mode-installation-directory cache var
meghanada-server-install-dir cache var
cider-repl-history-file cache var
rake-cache-file cache -
geben-temporary-file-directory cache var
ietf-docs-cache cache -
parinfer-rust-library-directory cache -

There are some other files (not in the table) which are currently put into dotspacemacs-directory and spacemacs-private-directory by default, those should also be audited.

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

Successfully merging this pull request may close these issues.

Don't put settings in ~/.emacs/.cache
2 participants