                 (cons 'font
                       (cond ((stringp doom-font) doom-font)
                             ((fontp doom-font) (font-xlfd-name doom-font))
-                            ((signal 'wrong-type-argument (list '(fontp stringp) doom-font))))))
-               (set-frame-font doom-font t t))
+                            ((signal 'wrong-type-argument (list '(fontp stringp) doom-font)))))))
               ((display-graphic-p)
                (setq doom-font (face-attribute 'default :font))))
         (when doom-serif-font

  (add-to-list 'kill-buffer-query-functions #'doom|protect-visible-buffer nil 'eq)
  (add-hook 'after-change-major-mode-hook #'doom|highlight-non-default-indentation)

  (add-hook 'after-make-frame-functions #'doom|reload-theme-in-frame-maybe)
  (add-hook 'after-delete-frame-functions #'doom|reload-theme-maybe)


       (signal 'doom-error e)))))

(defun doom|init-theme ()
  "Load the theme specified by `doom-theme'."
  (when (and doom-theme (not (memq doom-theme custom-enabled-themes)))
    (let ((doom--prefer-theme-elc t))
      (load-theme doom-theme t))))

(defun doom|reload-theme-maybe (_frame)
  "Reloads the theme if the display device has changed."
  (unless (cl-find doom-last-window-system (frame-list) :key #'framep-on-display)
    (setq doom-last-window-system nil)
    (doom|reload-theme-in-frame-maybe (selected-frame))))

(defun doom|reload-theme-in-frame-maybe (frame)
  "Reloads the theme if the display device has changed.

Getting themes to remain consistent across GUI Emacs, terminal Emacs and daemon
Emacs is hairy. `doom|init-theme' sorts out the initial GUI frame. Attaching
`doom|reload-theme-in-frame-maybe' to `after-make-frame-functions' sorts out
daemon and emacsclient frames.

There will still be issues with simultaneous gui and terminal (emacsclient)
frames, however. There's always `doom/reload-theme' if you need it!"
  (when (and doom-theme
             (framep frame)
             (not (eq doom-last-window-system (framep-on-display frame))))
