File tree 3 files changed +18
-13
lines changed
layers/+spacemacs/spacemacs-defaults
3 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 25
25
; ; Define various PATH variables, and set up load path.
26
26
27
27
; ;; Code:
28
+ (defgroup spacemacs nil
29
+ " Spacemacs customizations."
30
+ :group 'emacs
31
+ :prefix 'spacemacs- )
28
32
29
33
; ;;; PATH variables/constants
30
34
94
98
; ;
95
99
; ; This is based on `user-emacs-directory' , not `spacemacs-start-directory' ,
96
100
; ; because Spacemacs may be installed to a shared location and this directory
97
- ; ; and its children should be per-user.
98
- (defconst spacemacs-cache-directory
101
+ ; ; and its children should be per-user. Allow user to define their own path.
102
+ (defcustom spacemacs-cache-directory
99
103
(concat user-emacs-directory " .cache/" )
100
- " Spacemacs storage area for persistent files." )
104
+ " Spacemacs storage area for persistent files."
105
+ :group 'spacemacs
106
+ :type 'directory )
101
107
102
108
; ; ~/.emacs.d/.cache/auto-save
103
- (defconst spacemacs-auto-save-directory
104
- (concat spacemacs-cache-directory " auto-save/" )
109
+ (defconst spacemacs-auto-save-directory nil
105
110
" Spacemacs auto-save directory." )
106
111
112
+ (defun spacemacs/auto-save-directory ()
113
+ " Spacemacs auto-save directory."
114
+ (or spacemacs-auto-save-directory
115
+ (concat spacemacs-cache-directory " auto-save/" )))
116
+
107
117
108
118
; ;;; Setup cache directories
109
119
Original file line number Diff line number Diff line change 22
22
23
23
(setq message-log-max 16384 )
24
24
25
- (defgroup spacemacs nil
26
- " Spacemacs customizations."
27
- :group 'emacs
28
- :prefix 'spacemacs- )
29
-
30
25
(require 'subr-x nil 'noerror )
31
26
(require 'core-versions )
32
27
(require 'core-load-paths )
Original file line number Diff line number Diff line change @@ -203,18 +203,18 @@ or `nil' to only save and not visit the file."
203
203
204
204
; ; Auto-save file
205
205
(setq auto-save-default (not (null dotspacemacs-auto-save-file-location)))
206
- (setq auto-save-list-file-prefix (concat spacemacs- auto-save-directory))
206
+ (setq auto-save-list-file-prefix (spacemacs/ auto-save-directory))
207
207
; ; always save TRAMP URLs to cache directory no matter what is the value
208
208
; ; of `dotspacemacs-auto-save-file-location'
209
- (let ((autosave-dir (concat spacemacs- auto-save-directory " dist/" )))
209
+ (let ((autosave-dir (concat ( spacemacs/ auto-save-directory) " dist/" )))
210
210
(setq auto-save-file-name-transforms
211
211
`((" \\ `/[^/]*:\\ ([^/]*/\\ )*\\ ([^/]*\\ )\\ '" , autosave-dir t )))
212
212
(unless (or (file-exists-p autosave-dir)
213
213
(null dotspacemacs-auto-save-file-location))
214
214
(make-directory autosave-dir t )))
215
215
; ; Choose auto-save location
216
216
(cl-case dotspacemacs-auto-save-file-location
217
- (cache (let ((autosave-dir (concat spacemacs- auto-save-directory " site/" )))
217
+ (cache (let ((autosave-dir (concat ( spacemacs/ auto-save-directory) " site/" )))
218
218
(add-to-list 'auto-save-file-name-transforms
219
219
`(" .*" , autosave-dir t ) 'append )
220
220
(unless (file-exists-p autosave-dir)
You can’t perform that action at this time.
0 commit comments