core/core-configuration-layer: avoid loading the dependence layers

multiple times in (configuration-layer/declare-layer-dependencies)
This commit is contained in:
Lin Sun 2022-10-12 00:01:32 +00:00 committed by Maxi Wolff
parent d2ca781a8d
commit 9305824171
2 changed files with 5 additions and 2 deletions

View File

@ -825,6 +825,8 @@ Other:
- Add evil-jump-backward/forward (=C-o=/=C-i=) keybindings to
evil-evilified-state-map (thanks to Daniel Nicolai)
- Improve helm completion in spacemacs-help (thanks to @dankessler)
- Improve the =configuration-layer/declare-layer-dependencies= to avoid loading
the dependence layers multiple times (thank to Lin Sun)
*** Distribution changes
- Refactored =spacemacs-bootstrap=, =spacemacs-ui=, and =spacemacs-ui-visual=
layers:

View File

@ -1518,8 +1518,9 @@ If `SKIP-LAYER-DEPS' is non nil then skip loading of layer dependenciesl"
(defun configuration-layer/declare-layer-dependencies (layer-names)
"Function to be used in `layers.el' files to declare dependencies."
(dolist (x layer-names)
(add-to-list 'configuration-layer--layers-dependencies x)
(configuration-layer//load-layer-files x '("layers"))))
(unless (member x configuration-layer--layers-dependencies)
(add-to-list 'configuration-layer--layers-dependencies x)
(configuration-layer//load-layer-files x '("layers")))))
(defun configuration-layer//declare-used-layers (layers-specs)
"Declare used layers from LAYERS-SPECS list."