[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.
This commit is contained in:
Lucien Cartier-Tilet 2021-12-27 13:41:04 +01:00
parent 413ecb2d2b
commit 91b06ee7b1
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -386,10 +386,12 @@ dont. I prefer [[https://github.com/microsoft/cascadia-code][Cascadia Code]],
(defvar phundrak/default-font-name "Cascadia Code" (defvar phundrak/default-font-name "Cascadia Code"
"Default font.") "Default font.")
(add-hook 'server-after-make-frame-hook
(lambda ()
(when (find-font (font-spec :name phundrak/default-font-name)) (when (find-font (font-spec :name phundrak/default-font-name))
(set-face-attribute 'default nil (set-face-attribute 'default nil
:font phundrak/default-font-name :font phundrak/default-font-name
:height phundrak/default-font-size)) :height phundrak/default-font-size))))
#+end_src #+end_src
*** Frame Title *** Frame Title