From a363f85d33fd8d9d81380926753150d23adf8858 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 1 Nov 2017 23:23:26 -0400 Subject: [PATCH] core: for elpa dir, replace branch name by a variable set in .lock New variable configuration-layer-elpa-subdirectory set in .lock file. Now users creating a branch based on develop or master won't reinstall all the packages in a new elpa directory. --- .lock | 1 + core/core-configuration-layer.el | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.lock b/.lock index a251bb9cd..353b5b22f 100644 --- a/.lock +++ b/.lock @@ -2,6 +2,7 @@ (setq configuration-layer-stable-elpa-name "spacelpa") (setq configuration-layer-stable-elpa-version "0.300") +(setq configuration-layer-elpa-subdirectory "develop") (setq configuration-layer-elpa-archives `(("melpa" . "melpa.org/packages/") diff --git a/core/core-configuration-layer.el b/core/core-configuration-layer.el index b649f022a..eadae76ba 100644 --- a/core/core-configuration-layer.el +++ b/core/core-configuration-layer.el @@ -58,6 +58,10 @@ the .lock file at the root of the repository.") (defvar configuration-layer-stable-elpa-name "spacelpa" "Name of the stable ELPA repository. Should be defined in the lock file.") +(defvar configuration-layer-elpa-subdirectory "" + "Sub-directory name where to install ELPA packages. Should be defined in +the lock file.") + (defconst configuration-layer-stable-elpa-directory (expand-file-name (concat spacemacs-cache-directory "stable-elpa/" emacs-version "/")) @@ -88,7 +92,7 @@ This function also appends the name of the current branch of Spacemacs. If `dotspacemacs-elpa-subdirectory' is nil, then ROOT is used. Otherwise the subdirectory of ROOT is used." (expand-file-name - (spacemacs//git-get-current-branch) + configuration-layer-elpa-subdirectory (if (not dotspacemacs-elpa-subdirectory) root (let ((subdir (if (eq 'emacs-version dotspacemacs-elpa-subdirectory)