From 14e690d82cec26100ef95be5c4ba34e1d38220fd Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sun, 15 Jan 2017 23:09:57 -0500 Subject: [PATCH] core: add parameter to configuration-layer/make-all-packages New parameter `skip-layer-discovery', if non-nil then rediscovery of layers is skipped (used essentialy for the tests). --- core/core-configuration-layer.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/core-configuration-layer.el b/core/core-configuration-layer.el index a53c04f11..3d04feaee 100644 --- a/core/core-configuration-layer.el +++ b/core/core-configuration-layer.el @@ -889,13 +889,15 @@ Return nil if package object is not found." "Return a sorted list of PACKAGES objects." (sort packages (lambda (x y) (string< (symbol-name x) (symbol-name y))))) -(defun configuration-layer/make-all-packages () - "Create objects for _all_ packages supported by Spacemacs." +(defun configuration-layer/make-all-packages (&optional skip-layer-discovery) + "Create objects for _all_ packages supported by Spacemacs. +If SKIP-LAYER-DISCOVERY is non-nil then do not check for new layers." (let ((all-layers (configuration-layer/get-layers-list)) (configuration-layer--load-packages-files t) (configuration-layer--package-properties-read-onlyp t) (configuration-layer--inhibit-warnings t)) - (configuration-layer/discover-layers) + (unless skip-layer-discovery + (configuration-layer/discover-layers)) (configuration-layer/declare-layers all-layers) (configuration-layer/make-packages-from-layers all-layers)))