Try to prevent wrong-type-argument font-spec error

Addresses #164, #165
This commit is contained in:
Henrik Lissner 2017-07-28 19:54:23 +02:00
parent 5346670ab0
commit 7e4a0dbe95
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -193,16 +193,21 @@ local value, whether or not it's permanent-local. Therefore, we cycle
"Set the theme and load the font, in that order." "Set the theme and load the font, in that order."
(when doom-theme (when doom-theme
(load-theme doom-theme t)) (load-theme doom-theme t))
(condition-case-unless-debug ex
(when (display-graphic-p) (when (display-graphic-p)
(with-demoted-errors "FONT ERROR: %s"
(when (fontp doom-font) (when (fontp doom-font)
(set-frame-font doom-font nil (if frame (list frame) t))) (set-frame-font doom-font nil (if frame (list frame) t))
(set-face-attribute 'fixed-pitch frame :font doom-font))
;; Fallback to `doom-unicode-font' for Unicode characters ;; Fallback to `doom-unicode-font' for Unicode characters
(when (fontp doom-unicode-font) (when (fontp doom-unicode-font)
(set-fontset-font t 'unicode doom-unicode-font frame)) (set-fontset-font t 'unicode doom-unicode-font frame))
;; ...and for variable-pitch-mode: ;; ...and for variable-pitch-mode:
(when (fontp doom-variable-pitch-font) (when (fontp doom-variable-pitch-font)
(set-face-attribute 'variable-pitch frame :font doom-variable-pitch-font)))) (set-face-attribute 'variable-pitch frame :font doom-variable-pitch-font)))
('error
(lwarn 'doom-ui :error
"Failed to set fonts because %s"
(error-message-string ex))))
(run-hooks 'doom-init-ui-hook)) (run-hooks 'doom-init-ui-hook))
(defun doom|reload-ui-in-daemon (frame) (defun doom|reload-ui-in-daemon (frame)