Skip to content

Commit

Permalink
core/core-configuration-layer: avoid loading the dependence layers
Browse files Browse the repository at this point in the history
multiple times in (configuration-layer/declare-layer-dependencies)
  • Loading branch information
sunlin7 authored and smile13241324 committed Oct 18, 2022
1 parent d2ca781 commit 9305824
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.develop
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions core/core-configuration-layer.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 9305824

Please sign in to comment.