summaryrefslogtreecommitdiff
path: root/lisp/calendar/appt.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-07-03 09:12:39 +0000
committerGerd Moellmann <gerd@gnu.org>2000-07-03 09:12:39 +0000
commit7c0d9b8972c204c1601944c3042a9646dacd6de5 (patch)
treeb6dd1ab6245cf4089d71d0ea910caaab988e0d1a /lisp/calendar/appt.el
parente940c6dabf50b2180c75ea57fbc82671adc3d293 (diff)
downloademacs-7c0d9b8972c204c1601944c3042a9646dacd6de5.tar.gz
(appt-select-lowest-window): Use walk-windows
instead of cycling through windows with next-window.
Diffstat (limited to 'lisp/calendar/appt.el')
-rw-r--r--lisp/calendar/appt.el26
1 files changed, 8 insertions, 18 deletions
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index 04c8a3dd607..623d94cd96a 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -422,24 +422,14 @@ Usually just deletes the appointment buffer."
(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)