summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-03-20 18:59:22 +0000
committerRichard M. Stallman <rms@gnu.org>1994-03-20 18:59:22 +0000
commit516f92323eee050e13ab7310a95797d2bf38fdae (patch)
treef2db00a803149011436bab76e9b5702210ed4ef7 /lisp/subr.el
parentd786892e2d1df946a3781aadf526678e3e27209a (diff)
downloademacs-516f92323eee050e13ab7310a95797d2bf38fdae.tar.gz
(one-window-p): New argument all-frames.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 42105a44d56..368bf55cb6c 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -53,15 +53,21 @@ BODY should be a list of lisp expressions."
;;;; Window tree functions.
-(defun one-window-p (&optional nomini)
+(defun one-window-p (&optional nomini all-frames)
"Returns non-nil if there is only one window.
Optional arg NOMINI non-nil means don't count the minibuffer
-even if it is active."
+even if it is active.
+
+The optional arg ALL-FRAMES t means count windows on all frames.
+If it is `visible', count windows on all visible frames.
+ALL-FRAMES nil or omitted means count only the selected frame,
+plus the minibuffer it uses (which may be on another frame).
+If ALL-FRAMES is neither nil nor t, count only the selected frame."
(let ((base-window (selected-window)))
(if (and nomini (eq base-window (minibuffer-window)))
(setq base-window (next-window base-window)))
(eq base-window
- (next-window base-window (if nomini 'arg)))))
+ (next-window base-window (if nomini 'arg) all-frames))))
(defun walk-windows (proc &optional minibuf all-frames)
"Cycle through all visible windows, calling PROC for each one.