From 91b06ee7b19cf1e02b8c0b715e63329ad2554fcd Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Mon, 27 Dec 2021 13:41:04 +0100 Subject: [PATCH] [Emacs] Fix commit f5a9608 f5a9608 introduces a bug which prevents the font from being applied if Emacs is started as a server through systemd, since it does not start in GUI mode. This commit fixes this behavior by applying the user-defined font when a new frame is created since the new frame might be in GUI mode. --- org/config/emacs.org | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/org/config/emacs.org b/org/config/emacs.org index a146a65..e8ac1fc 100644 --- a/org/config/emacs.org +++ b/org/config/emacs.org @@ -386,10 +386,12 @@ don’t. I prefer [[https://github.com/microsoft/cascadia-code][Cascadia Code]], (defvar phundrak/default-font-name "Cascadia Code" "Default font.") -(when (find-font (font-spec :name phundrak/default-font-name)) - (set-face-attribute 'default nil - :font phundrak/default-font-name - :height phundrak/default-font-size)) +(add-hook 'server-after-make-frame-hook + (lambda () + (when (find-font (font-spec :name phundrak/default-font-name)) + (set-face-attribute 'default nil + :font phundrak/default-font-name + :height phundrak/default-font-size)))) #+end_src *** Frame Title