Function: auto-dark--check-and-set-dark-mode
auto-dark--check-and-set-dark-mode is a natively compiled function
defined in auto-dark.el.
Signature
(auto-dark--check-and-set-dark-mode)
Documentation
Set the theme according to the OS's dark mode state.
In order to prevent flickering, we only set the theme if we haven't already set the theme for the current dark mode state.
Source Code
;; Defined in /nix/store/fxsazwcy8jcsigjhcydkb81ip47xqcw0-emacs-packages-deps/share/emacs/site-lisp/elpa/auto-dark-20260313.2356/auto-dark.el
(defun auto-dark--check-and-set-dark-mode ()
"Set the theme according to the OS's dark mode state.
In order to prevent flickering, we only set the theme if we haven't
already set the theme for the current dark mode state."
;; This can be called during custom variable initialization, so ensure we only
;; do it once we’re certain initialization is far enough along.
(when (auto-dark--initialized-p)
(let ((appearance (auto-dark--current-system-mode)))
(unless (and (eq appearance auto-dark--last-dark-mode-state)
(equal custom-enabled-themes
(auto-dark--themes-for-mode appearance)))
(auto-dark--set-theme appearance)))))