Minor refactor of doom|init-fonts
Prefer native functions over macros, and conform to new convention of naming condition-case error variables "e". No, not the meme.
This commit is contained in:
parent
65d2b01333
commit
b42dd5c1db
1 changed files with 5 additions and 5 deletions
|
@ -551,7 +551,7 @@ frame's window-system, the theme will be reloaded.")
|
||||||
|
|
||||||
(defun doom|init-fonts ()
|
(defun doom|init-fonts ()
|
||||||
"Initialize fonts."
|
"Initialize fonts."
|
||||||
(condition-case-unless-debug ex
|
(condition-case e
|
||||||
(custom-set-faces
|
(custom-set-faces
|
||||||
(when (fontp doom-font)
|
(when (fontp doom-font)
|
||||||
(let ((xlfd (font-xlfd-name doom-font)))
|
(let ((xlfd (font-xlfd-name doom-font)))
|
||||||
|
@ -564,14 +564,14 @@ frame's window-system, the theme will be reloaded.")
|
||||||
(setq use-default-font-for-symbols nil)
|
(setq use-default-font-for-symbols nil)
|
||||||
(set-fontset-font t 'unicode doom-unicode-font nil)
|
(set-fontset-font t 'unicode doom-unicode-font nil)
|
||||||
nil))
|
nil))
|
||||||
('error
|
((debug error)
|
||||||
(if (string-prefix-p "Font not available: " (error-message-string ex))
|
(if (string-prefix-p "Font not available: " (error-message-string e))
|
||||||
(lwarn 'doom-ui :warning
|
(lwarn 'doom-ui :warning
|
||||||
"Could not find the '%s' font on your system, falling back to system font"
|
"Could not find the '%s' font on your system, falling back to system font"
|
||||||
(font-get (caddr ex) :family))
|
(font-get (caddr e) :family))
|
||||||
(lwarn 'doom-ui :error
|
(lwarn 'doom-ui :error
|
||||||
"Unexpected error while initializing fonts: %s"
|
"Unexpected error while initializing fonts: %s"
|
||||||
(error-message-string ex))))))
|
(error-message-string e))))))
|
||||||
|
|
||||||
(defun doom|init-theme ()
|
(defun doom|init-theme ()
|
||||||
"Set the theme and load the font, in that order."
|
"Set the theme and load the font, in that order."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue