If i understand the function window-list right it should return a window-list
in that order `other-window', `walk-windows' or `next-window' would return/
Move?! Is my understanding right? If not then i would vote for that order!
Ok, then current window-list function is buggy, because it returns the wrong
order.
This is function defined in emacs-version:
"21.4 (patch 10) \"Military Intelligence (RC5 Windows)\" XEmacs
Lucid"
(defun window-list (&optional frame minibuf window)
"Return a list of windows on FRAME, beginning with WINDOW.
FRAME and WINDOW default to the selected ones.
Optional second arg MINIBUF t means count the minibuffer window
even if not active. If MINIBUF is neither t nor nil it means
not to count the minibuffer even if it is active."
(setq window (or window (selected-window))
frame (or frame (selected-frame)))
(if (not (eq (window-frame window) frame))
(error "Window must be on frame."))
(let ((current-frame (selected-frame))
list)
(unwind-protect
(save-window-excursion
(select-frame frame)
(walk-windows
(function (lambda (cur-window)
(if (not (eq window cur-window))
(setq list (cons cur-window list)))))
minibuf)
(setq list (cons window list)))
(select-frame current-frame)))))
This should be (IMHO):
(defun window-list (&optional frame minibuf window)
"Return a list of windows on FRAME, beginning with WINDOW.
FRAME and WINDOW default to the selected ones.
Optional second arg MINIBUF t means count the minibuffer window
even if not active. If MINIBUF is neither t nor nil it means
not to count the minibuffer even if it is active."
(setq window (or window (selected-window))
frame (or frame (selected-frame)))
(if (not (eq (window-frame window) frame))
(error "Window must be on frame."))
(let ((current-frame (selected-frame))
list)
(unwind-protect
(save-window-excursion
(select-frame frame)
(walk-windows
(function (lambda (cur-window)
(if (not (eq window cur-window))
(setq list (cons cur-window list)))))
minibuf)
;; This is needed to get the right windows-order, i.e. the same
;; order of windows than `walk-windows' walks through!
(setq list (nreverse list))
(setq list (cons window list)))
(select-frame current-frame)))))
Ciao,
Klaus