comparison lisp/subr.el @ 6441:6ca895922340

(one-window-p): New argument all-frames.
author Richard M. Stallman <rms@gnu.org>
date Sun, 20 Mar 1994 18:59:22 +0000
parents 9217f29851c2
children 99ca8123a3ca
comparison
equal deleted inserted replaced
6440:fe511f97c2de 6441:6ca895922340
51 ;; 'args)))) 51 ;; 'args))))
52 52
53 53
54 ;;;; Window tree functions. 54 ;;;; Window tree functions.
55 55
56 (defun one-window-p (&optional nomini) 56 (defun one-window-p (&optional nomini all-frames)
57 "Returns non-nil if there is only one window. 57 "Returns non-nil if there is only one window.
58 Optional arg NOMINI non-nil means don't count the minibuffer 58 Optional arg NOMINI non-nil means don't count the minibuffer
59 even if it is active." 59 even if it is active.
60
61 The optional arg ALL-FRAMES t means count windows on all frames.
62 If it is `visible', count windows on all visible frames.
63 ALL-FRAMES nil or omitted means count only the selected frame,
64 plus the minibuffer it uses (which may be on another frame).
65 If ALL-FRAMES is neither nil nor t, count only the selected frame."
60 (let ((base-window (selected-window))) 66 (let ((base-window (selected-window)))
61 (if (and nomini (eq base-window (minibuffer-window))) 67 (if (and nomini (eq base-window (minibuffer-window)))
62 (setq base-window (next-window base-window))) 68 (setq base-window (next-window base-window)))
63 (eq base-window 69 (eq base-window
64 (next-window base-window (if nomini 'arg))))) 70 (next-window base-window (if nomini 'arg) all-frames))))
65 71
66 (defun walk-windows (proc &optional minibuf all-frames) 72 (defun walk-windows (proc &optional minibuf all-frames)
67 "Cycle through all visible windows, calling PROC for each one. 73 "Cycle through all visible windows, calling PROC for each one.
68 PROC is called with a window as argument. 74 PROC is called with a window as argument.
69 Optional second arg MINIBUF t means count the minibuffer window 75 Optional second arg MINIBUF t means count the minibuffer window