Function: mode-line-window-selected-p
mode-line-window-selected-p is a byte-compiled function defined in
bindings.el.gz.
Signature
(mode-line-window-selected-p)
Documentation
Return non-nil if we're updating the mode line for the selected window.
This function is meant to be called in :eval mode line constructs to allow altering the look of the mode line depending on whether the mode line belongs to the currently selected window or not.
Probably introduced at or before Emacs version 29.1.
Source Code
;; Defined in /usr/src/emacs/lisp/bindings.el.gz
(defun mode-line-window-selected-p ()
"Return non-nil if we're updating the mode line for the selected window.
This function is meant to be called in `:eval' mode line
constructs to allow altering the look of the mode line depending
on whether the mode line belongs to the currently selected window
or not."
(let ((window (selected-window)))
(or (eq window (old-selected-window))
(and (minibuffer-window-active-p (minibuffer-window))
(with-selected-window (minibuffer-window)
(eq window (minibuffer-selected-window)))))))