From: Jen-Chieh Shen Date: Tue, 18 Aug 2020 13:25:21 +0000 (+0200) Subject: Add optional ALL-FRAMES arfument to count-windows X-Git-Tag: emacs-28.0.90~6557 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a9603c77f8b08ff17cccd2938dd22206e37871fe;p=emacs.git Add optional ALL-FRAMES arfument to count-windows * lisp/window.el (count-windows): Allow counting the windows on all frames (bug#42872). --- diff --git a/lisp/window.el b/lisp/window.el index c02c9f37ee6..bb34a6d7b4c 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2642,12 +2642,17 @@ and no others." "Return t if WINDOW is the currently active minibuffer window." (and (window-live-p window) (eq window (active-minibuffer-window)))) -(defun count-windows (&optional minibuf) +(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 shall be counted. See `walk-windows' for the precise -meaning of this argument." - (length (window-list-1 nil minibuf))) +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))) ;;; Resizing windows. (defun window--size-to-pixel (window size &optional horizontal pixelwise round-maybe)