Function: count-windows

count-windows is a byte-compiled function defined in window.el.gz.

Signature

(count-windows &optional MINIBUF ALL-FRAMES)

Documentation

Return the number of live windows on the selected frame.

The optional argument MINIBUF specifies whether the minibuffer window is included in the count.

If ALL-FRAMES is non-nil, count the windows in all frames instead just the selected frame.

See walk-windows for the precise meaning of this argument.

Probably introduced at or before Emacs version 28.1.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun count-windows (&optional minibuf all-frames)
   "Return the number of live windows on the selected frame.

The optional argument MINIBUF specifies whether the minibuffer
window is included in the count.

If ALL-FRAMES is non-nil, count the windows in all frames instead
just the selected frame.

See `walk-windows' for the precise meaning of this argument."
   (length (window-list-1 nil minibuf all-frames)))