File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 2727; ;; Code:
2828
2929; ;;; PATH variables/constants
30+ (when (version<= emacs-version " 28" )
31+ (eval-when-compile (require 'subr-x ))) ; for the 'if-let*'
3032
3133; ; ~/.emacs.d
3234(defvar spacemacs-start-directory
9698; ; because Spacemacs may be installed to a shared location and this directory
9799; ; and its children should be per-user.
98100(defconst spacemacs-cache-directory
99- (concat user-emacs-directory " .cache/" )
101+ (if-let* ((spc-cache (getenv " SPACEMACSCACHE" )))
102+ spc-cache
103+ (if-let* ((dot-cache (concat user-emacs-directory " .cache/" ))
104+ (xdg-cache (getenv " XDG_CACHE_HOME" ))
105+ (spc-cache (expand-file-name " spacemacs/" xdg-cache))
106+ ((file-exists-p spc-cache)))
107+ spc-cache
108+ dot-cache))
100109 " Spacemacs storage area for persistent files." )
101110
102111; ; ~/.emacs.d/.cache/auto-save
Original file line number Diff line number Diff line change 3737- [[#dotfile-configuration][Dotfile Configuration]]
3838 - [[#dotfile-installation][Dotfile Installation]]
3939 - [[#alternative-dotdirectory][Alternative dotdirectory]]
40+ - [[#alternative-cache-directory][Alternative cache directory]]
4041 - [[#synchronization-of-dotfile-changes][Synchronization of dotfile changes]]
4142 - [[#testing-the-dotfile][Testing the dotfile]]
4243 - [[#dotfile-contents][Dotfile Contents]]
@@ -554,6 +555,17 @@ change the location of this directory.
554555so =~/.spacemacs= must not exist for =~/.spacemacs.d/init.el= to be used by
555556Spacemacs.
556557
558+ ** Alternative cache directory
559+ Spacemacs use the cache dir =.cache= under =user-emacs-directory=, normally it
560+ is =~/.emacs.d/.cache/=.
561+
562+ If the envrionment variable =XDG_CACHE_HOME= exists, Spacemacs will try the
563+ =spacemacs/= under the CACHE directory if the directory exists, for example
564+ =~/.cache/spacemacs/=.
565+
566+ To override the default cache directory, using the environment variable
567+ =SPACEMACSCACHE=.
568+
557569** Synchronization of dotfile changes
558570To apply the modifications made in =~/.spacemacs= press ~SPC f e R~. It will
559571re-execute the Spacemacs initialization process.
You can’t perform that action at this time.
0 commit comments