Commit 7c0d9b89 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(appt-select-lowest-window): Use walk-windows

instead of cycling through windows with next-window.
parent e940c6da
......@@ -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)
(setq bottom-edge next-bottom-edge)
(setq lowest-window this-window)))
(select-window this-window)
(if (eq last-window this-window)
(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)))
(defun appt-add (new-appt-time new-appt-msg)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment