spaceline: find a new way to speed it up without lazy loading it

Remove byte-compilation a startup time and put compilation of the mode line in
a window configuration change hook.
This commit is contained in:
syl20bnr 2018-06-14 09:58:26 -04:00
parent acfc8c5814
commit d7f5b58890
1 changed files with 9 additions and 2 deletions

View File

@ -50,9 +50,15 @@
(defun spacemacs-modeline/init-spaceline ()
(use-package spaceline-config
:defer 0.1
:if (memq (spacemacs/get-mode-line-theme-name) '(spacemacs all-the-icons custom))
:init
(add-hook 'emacs-startup-hook
(lambda ()
(spacemacs|add-transient-hook window-configuration-change-hook
(lambda ()
(setq spaceline-byte-compile t)
(spaceline-compile))
lazy-load-window-purpose)))
(progn
(add-hook 'spacemacs-post-theme-change-hook
'spacemacs/customize-powerline-faces)
@ -92,7 +98,8 @@
(t 'wave))
powerline-image-apple-rgb (eq window-system 'ns)
powerline-scale (or (spacemacs/mode-line-separator-scale) 1.5)
powerline-height (spacemacs/compute-mode-line-height)))
powerline-height (spacemacs/compute-mode-line-height)
spaceline-byte-compile nil))
:config
(progn
(spacemacs/customize-powerline-faces)