Variable: toolkit-theme-set-functions

toolkit-theme-set-functions is a variable defined in frame.el.gz.

Value

nil

Documentation

Abnormal hook run when the system theme is applied to Emacs.

Functions on this hook are called with the theme name as a symbol: light or dark. By the time the hook is called, toolkit-theme will already be set to one of these values as well.

Probably introduced at or before Emacs version 31.1.

Source Code

;; Defined in /usr/src/emacs/lisp/frame.el.gz
;; FIXME: This needs to be significantly improved before we can use it:
;; - Fix the "scope" to be consistent: the code below is partly per-frame
;;   and partly all-frames :-(
;; - Make it interact correctly with color themes (e.g. modus-themes).
;;   Maybe automatically disabling color themes that disagree with the
;;   selected value of `dark-mode'.
;; - Check interaction with "(in|re)verse-video".
;;
;; (define-minor-mode dark-mode
;;   "Use light text on dark background."
;;   :global t
;;   :group 'faces
;;   (when (eq dark-mode
;;             (eq 'light (frame--current-background-mode (selected-frame))))
;;     ;; FIXME: Change the face's SPEC instead?
;;     (set-face-attribute 'default nil
;;                         :foreground (face-attribute 'default :background)
;;                         :background (face-attribute 'default :foreground))
;;     (frame-set-background-mode (selected-frame))))

(defvar toolkit-theme-set-functions nil
  "Abnormal hook run when the system theme is applied to Emacs.
Functions on this hook are called with the theme name as a symbol:
`light' or `dark'.  By the time the hook is called, `toolkit-theme' will
already be set to one of these values as well.")