From ead626b6a77e89edab21e6f01a411b6a16976384 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 16 Oct 2019 22:25:12 +0200 Subject: [PATCH] Emacs: Protect against missing font. --- .emacs.d/lisp/visual.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.emacs.d/lisp/visual.el b/.emacs.d/lisp/visual.el index 3f3abcd9..1ffbdc0c 100644 --- a/.emacs.d/lisp/visual.el +++ b/.emacs.d/lisp/visual.el @@ -14,7 +14,9 @@ ;;; Font size (when (fboundp 'tool-bar-mode) ;; (set-face-attribute 'default nil :height 100) - (add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-12"))) + (when (find-font (font-spec :name "DejaVu Sans Mono-12")) + ;; Emacs raises an error if font is not found. + (add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-12")))) ;;; More readable but more space consuming; try on big screens. ;; (setq-default line-spacing 1)