core: fix deletion of some custom settings when installing new packages

Given the loading process of Spacemacs we have no choice but to set the
custom settings twice:
- once at the very beginning of startup
- once at the very end of loading

The first application of custom settings is to be sure that Emacs knows all the
defined settings before saving them to a file (otherwise we loose all the
settings that Emacs does not know of).
The second application is to override any settings set in dotfile functions
like `dotspacemacs/user-config`, users expect the custom settings to be the
effective ones.

This double loading issue is independent from the managment method used for
custom settings. Even with a separate custom-settings file explicitly loaded in
the dotfile we would have been forced to load this file twice to acheive the
expected result described here.

Note: Loading custom-settings twice is not ideal since they can have side
effects! Maybe an inhibit variable in Emacs can supress these side effects?
This commit is contained in:
syl20bnr 2016-12-18 11:38:29 -05:00
parent a9dd47691e
commit 0ab8b7ba35
1 changed files with 4 additions and 0 deletions

View File

@ -86,6 +86,10 @@ the final step of executing code in `emacs-startup-hook'.")
(toggle-frame-maximized))
(add-to-list 'default-frame-alist '(fullscreen . maximized)))
(dotspacemacs|call-func dotspacemacs/user-init "Calling dotfile user init...")
;; we must ensure that Emacs custom settings are defined before any call
;; to customize save functions
(dotspacemacs|call-func dotspacemacs/emacs-custom-settings
"Calling dotfile Emacs custom settings...")
(setq dotspacemacs-editing-style (dotspacemacs//read-editing-style-config
dotspacemacs-editing-style))
(configuration-layer/initialize)