diff options
author | Gerd Moellmann <gerd@gnu.org> | 2001-02-13 15:44:58 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2001-02-13 15:44:58 +0000 |
commit | 5ddc1b75c6b54d2fe1d0501e0148e193546dbfd3 (patch) | |
tree | 0f9d793afd65b796191e239e825f3784ce00c0ac /src | |
parent | 2e6621ca8cf108d51a84f1700aa44c90e7ebb82f (diff) | |
download | emacs-5ddc1b75c6b54d2fe1d0501e0148e193546dbfd3.tar.gz |
(window_loop) <GET_BUFFER_WINDOW>: Prefer to return
the selected window if it is showing the buffer in question.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 3 | ||||
-rw-r--r-- | src/window.c | 16 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 91a3aec56f3..670e999a9ea 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 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. diff --git a/src/window.c b/src/window.c index 769aa56a38d..4ddca7138f7 100644 --- a/src/window.c +++ b/src/window.c @@ -1669,7 +1669,6 @@ MINIBUF neither nil nor t means never include the minibuffer window.") (frame, minibuf, window) Lisp_Object frame, minibuf, window; { - if (NILP (window)) window = selected_window; if (NILP (frame)) @@ -1764,13 +1763,6 @@ window_loop (type, obj, mini, frames) 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; @@ -1799,8 +1791,12 @@ window_loop (type, obj, mini, frames) ? 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; |