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: Support spacemacs-cache-directory from env variable #16706

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion core/core-load-paths.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
;;; Code:

;;;; PATH variables/constants
(when (version<= emacs-version "28")
(eval-when-compile (require 'subr-x))) ; for the 'if-let*'

;; ~/.emacs.d
(defvar spacemacs-start-directory
Expand Down Expand Up @@ -96,7 +98,14 @@
;; because Spacemacs may be installed to a shared location and this directory
;; and its children should be per-user.
(defconst spacemacs-cache-directory
(concat user-emacs-directory ".cache/")
(if-let* ((spc-cache (getenv "SPACEMACSCACHE")))
spc-cache
(if-let* ((dot-cache (concat user-emacs-directory ".cache/"))
(xdg-cache (getenv "XDG_CACHE_HOME"))
(spc-cache (expand-file-name "spacemacs/" xdg-cache))
((file-exists-p spc-cache)))
spc-cache
dot-cache))
"Spacemacs storage area for persistent files.")

;; ~/.emacs.d/.cache/auto-save
Expand Down
12 changes: 12 additions & 0 deletions doc/DOCUMENTATION.org
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
- [[#dotfile-configuration][Dotfile Configuration]]
- [[#dotfile-installation][Dotfile Installation]]
- [[#alternative-dotdirectory][Alternative dotdirectory]]
- [[#alternative-cache-directory][Alternative cache directory]]
- [[#synchronization-of-dotfile-changes][Synchronization of dotfile changes]]
- [[#testing-the-dotfile][Testing the dotfile]]
- [[#dotfile-contents][Dotfile Contents]]
Expand Down Expand Up @@ -554,6 +555,17 @@ change the location of this directory.
so =~/.spacemacs= must not exist for =~/.spacemacs.d/init.el= to be used by
Spacemacs.

** Alternative cache directory
Spacemacs use the cache dir =.cache= under =user-emacs-directory=, normally it
is =~/.emacs.d/.cache/=.

If the envrionment variable =XDG_CACHE_HOME= exists, Spacemacs will try the
=spacemacs/= under the CACHE directory if the directory exists, for example
=~/.cache/spacemacs/=.

To override the default cache directory, using the environment variable
=SPACEMACSCACHE=.

** Synchronization of dotfile changes
To apply the modifications made in =~/.spacemacs= press ~SPC f e R~. It will
re-execute the Spacemacs initialization process.
Expand Down
Loading