core: replace package keyword :skip-install by :location site

This commit is contained in:
syl20bnr 2016-02-20 23:05:36 -05:00
parent 8bdc80bb6e
commit 308fb1118d
5 changed files with 16 additions and 28 deletions

View File

@ -316,13 +316,12 @@ This file containes the change log for the next major version of Spacemacs.
=packages-funcs.el= files
- New functions =configuration-layer/remove-layer= and
=configuration-layer/remove-layers=.
- New keyword =:skip-install= for packages, if non-nil then Spacemacs does not
handle the installation for the package (i.e. it has to be installed by
something else).
- New package location =site=, a site package is a package installed on the
host by a third party (ie. =mu4e= which is installed by =mu=)
- Improve =spacemacs|diminish= function (thanks to TheBB)
*** Other fixes and improvements
- Typos and documentation improvements (thanks to adrsta, andreas-h, balajisivaraman,
cpaulik, TheBB, StreakyCobra, xfq)
- Typos and documentation improvements (thanks to adrsta, andreas-h,
balajisivaraman, cpaulik, TheBB, StreakyCobra, xfq)
*** Core team members
- Sylvain Benner (syl20bnr)
- Eivind Fonn (TheBB)

View File

@ -101,18 +101,13 @@
:initform elpa
:type (satisfies (lambda (x)
(or (stringp x)
(member x '(built-in local elpa))
(member x '(built-in local site elpa))
(and (listp x) (eq 'recipe (car x))))))
:documentation "Location of the package.")
(step :initarg :step
:initform nil
:type (satisfies (lambda (x) (member x '(nil pre))))
:documentation "Initialization step.")
(skip-install :initarg :skip-install
:initform nil
:type boolean
:documentation
"If non-nil then this package is not installed by Spacemacs.")
(lazy-install :initarg :lazy-install
:initform nil
:type boolean
@ -356,16 +351,11 @@ Properties that can be copied are `:location', `:step' and `:excluded'."
(location (when (listp pkg) (plist-get (cdr pkg) :location)))
(step (when (listp pkg) (plist-get (cdr pkg) :step)))
(excluded (when (listp pkg) (plist-get (cdr pkg) :excluded)))
(skip-install-given-p (when (listp pkg) (plist-member (cdr pkg) :skip-install)))
(skip-install (when (listp pkg) (plist-get (cdr pkg) :skip-install)))
(protected (when (listp pkg) (plist-get (cdr pkg) :protected)))
(copyp (not (null obj)))
(obj (if obj obj (cfgl-package name-str :name name-sym))))
(when location (oset obj :location location))
(when step (oset obj :step step))
;; since skip-install can reasonably be expected to be set to nil, we
;; must explicitly check if it's a key in the plist before overriding
(when skip-install-given-p (oset obj :skip-install skip-install))
(oset obj :excluded excluded)
;; cannot override protected packages
(unless copyp
@ -473,9 +463,8 @@ Properties that can be copied are `:location', `:step' and `:excluded'."
"Return the distant packages (ie to be intalled) that are effectively used."
(configuration-layer/filter-objects
packages (lambda (x) (and (not (null (oref x :owner)))
(not (memq (oref x :location) '(built-in local)))
(not (memq (oref x :location) '(built-in site local)))
(not (stringp (oref x :location)))
(not (oref x :skip-install))
(not (oref x :excluded))))))
(defun configuration-layer//get-private-layer-dir (name)

View File

@ -11,7 +11,7 @@
(setq mu4e-packages
'(
(mu4e :skip-install t)
(mu4e :location site)
mu4e-alert
mu4e-maildirs-extension
org

View File

@ -28,7 +28,7 @@
;; https://github.com/7696122/evil-terminal-cursor-changer/issues/8
(evil-terminal-cursor-changer :excluded t)
evil-tutor
(evil-unimpaired :skip-install t)))
(evil-unimpaired :location local)))
(defun spacemacs-evil/init-evil-anzu ()
(use-package evil-anzu

View File

@ -585,6 +585,14 @@
(spacemacs-buffer/loading-animation nil ((:output nil))))
(configuration-layer//configure-packages-2 `(,pkg)))))
(ert-deftest test-configure-packages-2--site-package-is-configured()
(let ((pkg (cfgl-package "pkg" :name 'pkg :owner 'layer1 :location 'site))
(mocker-mock-default-record-cls 'mocker-stub-record))
(mocker-let
((configuration-layer//configure-package (p) ((:occur 1)))
(spacemacs-buffer/loading-animation nil ((:output nil))))
(configuration-layer//configure-packages-2 `(,pkg)))))
(ert-deftest test-configure-packages-2--protected-package-is-configured()
(let ((pkg (cfgl-package "pkg" :name 'pkg :owner 'layer1 :protected t))
(mocker-mock-default-record-cls 'mocker-stub-record))
@ -601,14 +609,6 @@
(spacemacs-buffer/loading-animation nil ((:output nil))))
(configuration-layer//configure-packages-2 `(,pkg)))))
(ert-deftest test-configure-packages-2--skip-install-package-is-configured()
(let ((pkg (cfgl-package "pkg" :name 'pkg :owner 'layer1 :skip-install t))
(mocker-mock-default-record-cls 'mocker-stub-record))
(mocker-let
((configuration-layer//configure-package (p) ((:occur 1)))
(spacemacs-buffer/loading-animation nil ((:output nil))))
(configuration-layer//configure-packages-2 `(,pkg)))))
(ert-deftest test-configure-packages-2--excluded-package-is-not-configured()
(let ((pkg (cfgl-package "pkg" :name 'pkg :owner 'layer1 :excluded t))
(mocker-mock-default-record-cls 'mocker-stub-record))