core/core-load-path.el: auto locate spacemacs-start-directory

This commit is contained in:
Lin Sun 2022-08-11 00:00:05 +00:00 committed by Maxi Wolff
parent bbbea08db2
commit ecb87b53f7
No known key found for this signature in database
GPG Key ID: 2DD07025BFDBD89A
3 changed files with 6 additions and 11 deletions

View File

@ -386,16 +386,13 @@ In other word, in default installation, Emacs find and load
If you want to install Spacemacs to a different location, you need to make If you want to install Spacemacs to a different location, you need to make
sure it's loaded by Emacs in one of its [init file][Emacs: Find Init]. sure it's loaded by Emacs in one of its [init file][Emacs: Find Init].
For example, if you've cloned Spacemacs to `$HOME/spacemacs`, and if you use For example, if you've cloned Spacemacs to `$HOME/Spacemacs`, and if you use
`$HOME/.emacs.el` as Emacs init file, then the following lines in `$HOME/.emacs.el` as Emacs init file, then the following lines in
`$HOME/.emacs.el`: `$HOME/.emacs.el`:
```elisp ```elisp
;; set variable `spacemacs-start-directory' to point to your Spacemacs ;; load Spacemacs's initialization file, "~" is equivalent to "$HOME"
;; installation location, "~" is equivalent to "$HOME" (load-file "~/Spacemacs/init.el")
(setq spacemacs-start-directory "~/.emacs.d/spacemacs")
;; load Spacemacs's initialization file
(load-file (expand-file-name "init.el" spacemacs-start-directory))
``` ```
# First Launch and Configuration # First Launch and Configuration

View File

@ -34,7 +34,7 @@
;; ~/.emacs.d ;; ~/.emacs.d
(defvar spacemacs-start-directory (defvar spacemacs-start-directory
(expand-file-name user-emacs-directory) (concat (file-name-directory (or load-file-name buffer-file-name)) "../")
"Spacemacs start directory.") "Spacemacs start directory.")
;; ~/.emacs.d/assets ;; ~/.emacs.d/assets

View File

@ -28,11 +28,9 @@
;; see `SPC h . dotspacemacs-gc-cons' for more info ;; see `SPC h . dotspacemacs-gc-cons' for more info
(defconst emacs-start-time (current-time)) (defconst emacs-start-time (current-time))
(setq gc-cons-threshold 402653184 gc-cons-percentage 0.6) (setq gc-cons-threshold 402653184 gc-cons-percentage 0.6)
(load (concat (file-name-directory load-file-name) (load (concat (file-name-directory load-file-name) "core/core-load-paths")
"core/core-versions")
nil (not init-file-debug)) nil (not init-file-debug))
(load (concat (file-name-directory load-file-name) (load (concat spacemacs-core-directory "core-versions")
"core/core-load-paths")
nil (not init-file-debug)) nil (not init-file-debug))
(load (concat spacemacs-core-directory "core-dumper") (load (concat spacemacs-core-directory "core-dumper")
nil (not init-file-debug)) nil (not init-file-debug))