Change how themes, fonts & modelines are loaded

WARNING: THIS IS A BREAKING CHANGE FOR THEME/FONT/NLINUM CUSTOMIZATIONS.

This change was motivated by the need to decouple theme and font loading
from the ui/doom module.

Now, it is doom-core's purview. Theme and fonts are loaded after
initfiles are read (attached to the doom-init-ui-hook hook), giving
other modules (especially private ones) a chance to change the theme or
fonts.

+ Refactor core-ui.el
+ New init hook: doom-init-ui-hook
+ Decouple theme/font loading from ui/doom
+ Load modelines are doom-init-ui-hook
+ New theme/font variables (replaces old ui/doom variables)
  + doom-theme
  + doom-font
  + doom-variable-pitch-font
  + doom-unicode-font
+ Change nlinum variables
  + doom-line-number-lpad
  + doom-line-number-rpad
  + doom-line-number-pad-char

Addresses #117
This commit is contained in:
Henrik Lissner 2017-06-28 16:18:22 +02:00
parent 804fd31aab
commit ecd8ad0f46
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
8 changed files with 147 additions and 132 deletions

View file

@ -563,25 +563,33 @@ with `evil-ex-substitute', and/or 4. The number of active `iedit' regions."
(bar " %b ")
(media-info major-mode))
;;
(doom-set-modeline 'main t)
;; This scratch buffer is already created, and doesn't get a modeline. For the
;; love of Emacs, someone give the man a modeline!
(with-current-buffer "*scratch*"
(doom-set-modeline 'main))
;;
;; Hooks
;;
(defun +doom-modeline|init ()
"Set the default modeline."
(doom-set-modeline 'main t)
;; This scratch buffer is already created and doesn't get a modeline. For the
;; love of Emacs, someone give the man a modeline!
(with-current-buffer "*scratch*"
(doom-set-modeline 'main)))
(defun +doom-modeline|set-special-modeline ()
(doom-set-modeline 'special))
(defun +doom-modeline|set-media-modeline ()
(doom-set-modeline 'media))
;;
;; Bootstrap
;;
(add-hook 'doom-init-ui-hook #'+doom-modeline|init)
(add-hook 'org-src-mode-hook #'+doom-modeline|set-special-modeline)
(add-hook 'image-mode-hook #'+doom-modeline|set-media-modeline)
(add-hook 'circe-mode-hook #'+doom-modeline|set-special-modeline)
(add-hook 'image-mode-hook #'+doom-modeline|set-media-modeline)
(add-hook 'circe-mode-hook #'+doom-modeline|set-special-modeline)