changeset 26268:6e6ad5d67263

(walk-windows): If ALL-FRAMES is a frame, start on that frame. Use save-selected-window.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 01 Nov 1999 12:14:40 +0000
parents 0af8b2c70e22
children ea945bfd5c7c
files lisp/window.el
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/window.el	Mon Nov 01 11:44:58 1999 +0000
+++ b/lisp/window.el	Mon Nov 01 12:14:40 1999 +0000
@@ -62,17 +62,21 @@
 ALL-FRAMES = `visible' means include windows on all visible frames.
 ALL-FRAMES = 0 means include windows on all visible and iconified frames.
 ALL-FRAMES = t means include windows on all frames including invisible frames.
+If ALL-FRAMES is a frame, it means include windows on that frame.
 Anything else means restrict to the selected frame."
   ;; If we start from the minibuffer window, don't fail to come back to it.
   (if (window-minibuffer-p (selected-window))
       (setq minibuf t))
-  (let* ((walk-windows-start (selected-window))
-	 (walk-windows-current walk-windows-start))
-    (while (progn
-	     (setq walk-windows-current
-		   (next-window walk-windows-current minibuf all-frames))
-	     (funcall proc walk-windows-current)
-	     (not (eq walk-windows-current walk-windows-start))))))
+  (save-selected-window
+    (if (framep all-frames)
+	(select-window (frame-first-window all-frames)))
+    (let* ((walk-windows-start (selected-window))
+	   (walk-windows-current walk-windows-start))
+      (while (progn
+	       (setq walk-windows-current
+		     (next-window walk-windows-current minibuf all-frames))
+	       (funcall proc walk-windows-current)
+	       (not (eq walk-windows-current walk-windows-start)))))))
 
 (defun minibuffer-window-active-p (window)
   "Return t if WINDOW (a minibuffer window) is now active."