# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1220083463 -7200
# Node ID efdb818642191b13bdb1cebb6188f6ed8823cac1
# Parent b82fdf7305eef16a68a94d48a5b532a589f0e55b
Add #'only-window-p, like #'one-window-p but passing the window explicitly.
lisp/ChangeLog addition:
2008-08-30 Aidan Kehoe <kehoea(a)parhasard.net>
* window.el (only-window-p): New.
Check if WINDOW is the only window in some context, normally its
frame.
(one-window-p):
Implemented this in terms of #'only-window-p, calling it on the
selected window.
diff -r b82fdf7305ee -r efdb81864219 lisp/ChangeLog
--- a/lisp/ChangeLog Wed Aug 27 21:47:21 2008 +0200
+++ b/lisp/ChangeLog Sat Aug 30 10:04:23 2008 +0200
@@ -1,3 +1,12 @@
+2008-08-30 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * window.el (only-window-p): New.
+ Check if WINDOW is the only window in some context, normally its
+ frame.
+ (one-window-p):
+ Implemented this in terms of #'only-window-p, calling it on the
+ selected window.
+
2008-08-27 Aidan Kehoe <kehoea(a)parhasard.net>
* subr.el (skip-chars-quote):
diff -r b82fdf7305ee -r efdb81864219 lisp/window.el
--- a/lisp/window.el Wed Aug 27 21:47:21 2008 +0200
+++ b/lisp/window.el Sat Aug 30 10:04:23 2008 +0200
@@ -33,16 +33,19 @@
;;;; Window tree functions.
-(defun one-window-p (&optional nomini which-frames which-devices)
- "Return non-nil if the selected window is the only window (in its frame).
-Optional arg NOMINI non-nil means don't count the minibuffer
-even if it is active.
+;; XEmacs addition, to expose WINDOW.
+(defun only-window-p (&optional window nomini which-frames which-devices)
+ "Return non-nil if WINDOW is the only window in some context,
+normally its frame. Optional arg NOMINI non-nil means don't count the
+minibuffer even if it is active.
-By default, only the windows in the selected frame are considered.
-The optional argument WHICH-FRAMES changes this behavior:
-WHICH-FRAMES nil or omitted means count only the selected frame,
+The optional argument WHICH-FRAMES changes the frames that are considered:
+
+WHICH-FRAMES nil or omitted means count only WINDOW's frame,
plus the minibuffer it uses (which may be on another frame).
-WHICH-FRAMES = `visible' means include windows on all visible frames.
+\(But, for all values of WHICH-FRAMES, see the documentation for the
+WHICH-DEVICES argument.)
+WHICH-FRAMES = `visible' means include windows on all visible frames
WHICH-FRAMES = 0 means include windows on all visible and iconified frames.
WHICH-FRAMES = t means include windows on all frames including invisible frames.
If WHICH-FRAMES is any other value, count only the selected frame.
@@ -56,11 +59,19 @@
If a device type, search all devices of that type.
If `window-system', search all devices on window-system consoles.
Any other non-nil value means search all devices."
- (let ((base-window (selected-window)))
- (if (and nomini (eq base-window (minibuffer-window)))
+ (let ((base-window (or window (selected-window))))
+ (if (and nomini (eq base-window
+ (minibuffer-window (window-frame base-window))))
(setq base-window (next-window base-window)))
(eq base-window
(next-window base-window (if nomini 'arg) which-frames which-devices))))
+
+(defun one-window-p (&optional nomini which-frames which-devices)
+ "Return the result of calling `only-window-p' on the selected window.
+
+See that function's documentation for the meaning of the NOMINI,
+WHICH-FRAMES and WHICH-DEVICES arguments."
+ (only-window-p (selected-window) nomini which-frames which-devices))
(defun walk-windows (function &optional minibuf which-frames which-devices)
"Cycle through all visible windows, calling FUNCTION for each one.
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches