Warn if layers changed outside dotspacemacs/layers
This commit is contained in:
parent
2f263e998c
commit
1a97aeb215
|
@ -375,6 +375,8 @@ refreshed during the current session."
|
|||
"Synchronize declared layers in dotfile with spacemacs.
|
||||
If NO-INSTALL is non nil then install steps are skipped."
|
||||
(dotspacemacs|call-func dotspacemacs/layers "Calling dotfile layers...")
|
||||
(setq dotspacemacs--configuration-layers-saved
|
||||
dotspacemacs-configuration-layers)
|
||||
(when (spacemacs-buffer//choose-banner)
|
||||
(spacemacs-buffer//inject-version))
|
||||
;; declare used layers then packages as soon as possible to resolve
|
||||
|
|
|
@ -126,6 +126,9 @@ whenever you start Emacs.")
|
|||
(defvar dotspacemacs-configuration-layers '(emacs-lisp)
|
||||
"List of configuration layers to load.")
|
||||
|
||||
(defvar dotspacemacs--configuration-layers-saved nil
|
||||
"Saved value of `dotspacemacs-configuration-layers' after sync.")
|
||||
|
||||
(defvar dotspacemacs-themes '(spacemacs-dark
|
||||
spacemacs-light)
|
||||
"List of themes, the first of the list is loaded when spacemacs starts.
|
||||
|
@ -362,6 +365,16 @@ are caught and signalled to user in spacemacs buffer."
|
|||
(error-message-string err))
|
||||
t))))))
|
||||
|
||||
(defun dotspacemacs//check-layers-changed ()
|
||||
"Check if the value of `dotspacemacs-configuration-layers'
|
||||
changed, and issue a warning if it did."
|
||||
(unless (eq dotspacemacs-configuration-layers
|
||||
dotspacemacs--configuration-layers-saved)
|
||||
(spacemacs-buffer/warning
|
||||
"`dotspacemacs-configuration-layers' was changed outside of `dotspacemacs/layers'.")))
|
||||
(add-hook 'spacemacs-post-user-config-hook
|
||||
'dotspacemacs//check-layers-changed)
|
||||
|
||||
(defun dotspacemacs//read-editing-style-config (config)
|
||||
"Read editing style CONFIG: apply variables and return the editing style.
|
||||
CONFIG can be the symbol of an editing style or a list where the car is
|
||||
|
|
|
@ -225,7 +225,7 @@ defer call using `spacemacs-post-user-config-hook'."
|
|||
((configuration-layer/layer-usedp 'ivy)
|
||||
'ivy)
|
||||
(t 'helm))
|
||||
(pp-to-string dotspacemacs-configuration-layers)
|
||||
(pp-to-string dotspacemacs--configuration-layers-saved)
|
||||
(bound-and-true-p system-configuration-features)))
|
||||
|
||||
(defun spacemacs/describe-system-info ()
|
||||
|
|
Loading…
Reference in New Issue