2001-02-13 Gerd Moellmann <gerd@gnu.org>
+ * window.c (window_loop) <GET_BUFFER_WINDOW>: Prefer to return
+ the selected window if it is showing the buffer in question.
+
* dired.c (directory_files_internal): Initialize errno.
(toplevel): Include errno.h.
(frame, minibuf, window)
Lisp_Object frame, minibuf, window;
{
-
if (NILP (window))
window = selected_window;
if (NILP (frame))
else
window = FRAME_SELECTED_WINDOW (SELECTED_FRAME ());
- /* Figure out the last window we're going to mess with. Since
- Fnext_window, given the same options, is guaranteed to go in a
- ring, we can just use Fprevious_window to find the last one.
-
- We can't just wait until we hit the first window again, because
- it might be deleted. */
-
windows = window_list_1 (window, mini ? Qt : Qnil, frame_arg);
GCPRO1 (windows);
best_window = Qnil;
? EQ (window, minibuf_window)
: 1))
{
- UNGCPRO;
- return window;
+ if (NILP (best_window))
+ best_window = window;
+ else if (EQ (window, selected_window))
+ /* For compatibility with 20.x, prefer to return
+ selected-window. */
+ best_window = window;
}
break;