changeset 30001:55656f797f82

(appt-select-lowest-window): Use walk-windows instead of cycling through windows with next-window.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 03 Jul 2000 09:12:39 +0000
parents 323c0e2c2032
children edb654a13bf1
files lisp/calendar/appt.el
diffstat 1 files changed, 8 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/appt.el	Mon Jul 03 09:12:12 2000 +0000
+++ b/lisp/calendar/appt.el	Mon Jul 03 09:12:39 2000 +0000
@@ -422,24 +422,14 @@
 
 (defun appt-select-lowest-window ()
 "Select the lowest window on the frame."
-  (let* ((lowest-window (selected-window))
-	 (bottom-edge (nth 3 (window-edges)))
-         (last-window (previous-window))
-         (window-search t))
-    (while window-search
-      (let* ((this-window (next-window))
-             (next-bottom-edge (nth 3 (window-edges this-window))))
-        (if (< bottom-edge next-bottom-edge)
-            (progn
-              (setq bottom-edge next-bottom-edge)
-              (setq lowest-window this-window)))
-
-        (select-window this-window)
-        (if (eq last-window this-window)
-            (progn
-              (select-window lowest-window)
-              (setq window-search nil)))))))
-
+  (let ((lowest-window (selected-window))
+	(bottom-edge (nth 3 (window-edges))))
+    (walk-windows (lambda (w)
+		    (let ((next-bottom-edge (nth 3 (window-edges w))))
+		      (when (< bottom-edge next-bottom-edge)
+			(setq bottom-edge next-bottom-edge
+			      lowest-window w)))))
+    (select-window lowest-window)))
 
 ;;;###autoload
 (defun appt-add (new-appt-time new-appt-msg)