 ;;
 ;;; Theme & font
 
-;; Use a psuedo theme to store internal and user faces + custom.el settings
+;; Use a pseudo theme to store internal and user faces + custom.el settings
 ;; without risk of them being written to `custom-file'.
 (custom-declare-theme 'doom nil)
 

        (when (and (not no-enable) (custom-theme-enabled-p theme))
          (setq doom-theme theme)
          (put 'doom-theme 'previous-themes last-themes)
          (doom-run-hooks 'doom-load-theme-hook))))))


;;


(defun doom-init-theme-h (&optional frame)
  "Load the theme specified by `doom-theme' in FRAME."
  (if doom-theme
      (unless (custom-theme-enabled-p doom-theme)
        ;; Fix #1397: if `doom-init-theme-h' is used on `after-make-frame-functions'
        ;; (for daemon sessions), the new frame must be focused to ensure the theme
        ;; loads correctly.
        (with-selected-frame (or frame (selected-frame))
          (load-theme doom-theme t)))
    ;; Ensure custom faces apply and have highest precendence
    (enable-theme 'doom)))

(defadvice! doom--load-theme-a (orig-fn theme &optional no-confirm no-enable)
  "Record `doom-theme', disable old themes, and trigger `doom-load-theme-hook'."
