Make elpa directory more flexible
- Rename variable to dotspacemacs-elpa-subdirectory - Allow arbitrary form to be evaluated
This commit is contained in:
parent
6b23983205
commit
36f3b63079
|
@ -46,10 +46,20 @@
|
|||
configuration-layer-private-directory))
|
||||
"Spacemacs default directory for private layers.")
|
||||
|
||||
(defun configuration-layer/emacs-version-dirname ()
|
||||
"Directory name for current emacs version.
|
||||
Example output: \"24.5\"."
|
||||
(format "%d%s%d" emacs-major-version version-separator emacs-minor-version))
|
||||
(defun configuration-layer/elpa-directory (root)
|
||||
"Evaluate the correct package subdirectory of ROOT. This is
|
||||
done according to the value of `dotspacemacs-elpa-subdirectory'.
|
||||
If it is nil, then ROOT is returned. Otherwise a subdirectory of
|
||||
ROOT is returned."
|
||||
(if (not dotspacemacs-elpa-subdirectory)
|
||||
root
|
||||
(let ((subdir (if (eq 'emacs-version dotspacemacs-elpa-subdirectory)
|
||||
(format "%d%s%d"
|
||||
emacs-major-version
|
||||
version-separator
|
||||
emacs-minor-version)
|
||||
(eval dotspacemacs-elpa-subdirectory))))
|
||||
(file-name-as-directory (expand-file-name subdir root)))))
|
||||
|
||||
(defvar configuration-layer-rollback-directory
|
||||
(concat spacemacs-cache-directory ".rollback/")
|
||||
|
@ -249,15 +259,10 @@ cache folder.")
|
|||
"Initialize `package.el'."
|
||||
(setq configuration-layer--refresh-package-timeout dotspacemacs-elpa-timeout)
|
||||
(unless package--initialized
|
||||
(when dotspacemacs-enable-multiple-emacs-version
|
||||
(setq configuration-layer-rollback-directory
|
||||
(file-name-as-directory
|
||||
(expand-file-name (configuration-layer/emacs-version-dirname)
|
||||
configuration-layer-rollback-directory)))
|
||||
(setq package-user-dir
|
||||
(file-name-as-directory
|
||||
(expand-file-name (configuration-layer/emacs-version-dirname)
|
||||
package-user-dir))))
|
||||
(setq configuration-layer-rollback-directory
|
||||
(configuration-layer/elpa-directory configuration-layer-rollback-directory))
|
||||
(setq package-user-dir
|
||||
(configuration-layer/elpa-directory package-user-dir))
|
||||
(setq package-archives (configuration-layer//resolve-package-archives
|
||||
configuration-layer--elpa-archives))
|
||||
;; optimization, no need to activate all the packages so early
|
||||
|
|
|
@ -63,10 +63,10 @@ environment, otherwise it is strongly recommended to let it set to t.")
|
|||
(defvar dotspacemacs-elpa-timeout 5
|
||||
"Maximum allowed time in seconds to contact an ELPA repository.")
|
||||
|
||||
(defvar dotspacemacs-enable-multiple-emacs-version nil
|
||||
"If non nil, different emacs versions have different package directories.
|
||||
e.g. for Emacs 24.5, packages are stored in elpa/24.5/. Rollback
|
||||
directories are also separated.")
|
||||
(defvar dotspacemacs-elpa-subdirectory nil
|
||||
"If non-nil, a form that evaluates to a package directory. For
|
||||
example, to use different package directories for different Emacs
|
||||
versions, set this to `emacs-version'.")
|
||||
|
||||
(defvar dotspacemacs-configuration-layer-path '()
|
||||
"List of additional paths where to look for configuration layers.
|
||||
|
|
|
@ -91,10 +91,10 @@ values."
|
|||
;; new versions works via git commands, thus it calls GitHub services
|
||||
;; whenever you start Emacs. (default nil)
|
||||
dotspacemacs-check-for-update nil
|
||||
;; If non nil, different emacs versions have different package directories.
|
||||
;; e.g. for Emacs 24.5, packages are stored in elpa/24.5/. Rollback
|
||||
;; directories are also separated.
|
||||
dotspacemacs-enable-multiple-emacs-version nil
|
||||
;; If non-nil, a form that evaluates to a package directory. For example, to
|
||||
;; use different package directories for different Emacs versions, set this
|
||||
;; to `emacs-version'.
|
||||
dotspacemacs-elpa-subdirectory nil
|
||||
;; One of `vim', `emacs' or `hybrid'.
|
||||
;; `hybrid' is like `vim' except that `insert state' is replaced by the
|
||||
;; `hybrid state' with `emacs' key bindings. The value can also be a list
|
||||
|
|
Loading…
Reference in New Issue