emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a9603c7: Add optional ALL-FRAMES arfument to count-windows


From: Lars Ingebrigtsen
Subject: master a9603c7: Add optional ALL-FRAMES arfument to count-windows
Date: Tue, 18 Aug 2020 09:25:34 -0400 (EDT)

branch: master
commit a9603c77f8b08ff17cccd2938dd22206e37871fe
Author: Jen-Chieh Shen <jcs090218@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Add optional ALL-FRAMES arfument to count-windows
    
    * lisp/window.el (count-windows): Allow counting the windows on
    all frames (bug#42872).
---
 lisp/window.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/window.el b/lisp/window.el
index c02c9f3..bb34a6d 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]