From b42dd5c1db00ec26149c4857844f917deac65145 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 3 Jul 2018 03:38:18 +0200 Subject: [PATCH] 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. --- core/core-ui.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/core-ui.el b/core/core-ui.el index b6572cf1f..24ad30a3d 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -551,7 +551,7 @@ frame's window-system, the theme will be reloaded.") (defun doom|init-fonts () "Initialize fonts." - (condition-case-unless-debug ex + (condition-case e (custom-set-faces (when (fontp 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) (set-fontset-font t 'unicode doom-unicode-font nil) nil)) - ('error - (if (string-prefix-p "Font not available: " (error-message-string ex)) + ((debug error) + (if (string-prefix-p "Font not available: " (error-message-string e)) (lwarn 'doom-ui :warning "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 "Unexpected error while initializing fonts: %s" - (error-message-string ex)))))) + (error-message-string e)))))) (defun doom|init-theme () "Set the theme and load the font, in that order."