summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-09-02 05:13:11 +0000
committerRichard M. Stallman <rms@gnu.org>1996-09-02 05:13:11 +0000
commitcad039a5fefd691cbf8362d49cf7c35dd1bd3a53 (patch)
treee194ee103a0d7166c75cb585231517a4b39c9352 /src/window.c
parentf8d555e75896a78a9b8c8bc175bb3b7a34bc3e79 (diff)
downloademacs-cad039a5fefd691cbf8362d49cf7c35dd1bd3a53.tar.gz
(unshow_buffer): Clear last_selected_window slot, maybe.
(Fset_window_buffer): Set last_selected_window slot. (Fselect_window): Set last_selected_window slot. (delete_all_subwindows): Maybe call unshow_buffer.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c
index 9b59640497d..925b4d6aed9 100644
--- a/src/window.c
+++ b/src/window.c
@@ -692,6 +692,9 @@ unshow_buffer (w)
if (XBUFFER (buf) != XMARKER (w->pointm)->buffer)
abort ();
+ if (w == XWINDOW (XBUFFER (buf)->last_selected_window))
+ XBUFFER (buf)->last_selected_window = Qnil;
+
#if 0
if (w == XWINDOW (selected_window)
|| ! EQ (buf, XWINDOW (selected_window)->buffer))
@@ -1842,6 +1845,10 @@ BUFFER can be a buffer or buffer name.")
}
w->buffer = buffer;
+
+ if (EQ (window, selected_window))
+ XBUFFER (w->buffer)->last_selected_window = window;
+
XSETFASTINT (w->window_end_pos, 0);
w->window_end_valid = Qnil;
XSETFASTINT (w->hscroll, 0);
@@ -1918,6 +1925,8 @@ before each command.")
record_buffer (w->buffer);
Fset_buffer (w->buffer);
+ XBUFFER (w->buffer)->last_selected_window = window;
+
/* Go to the point recorded in the window.
This is important when the buffer is in more
than one window. It also matters when
@@ -3221,6 +3230,9 @@ delete_all_subwindows (w)
w->height = w->buffer; /* See Fset_window_configuration for excuse. */
+ if (!NILP (w->buffer))
+ unshow_buffer (w);
+
/* We set all three of these fields to nil, to make sure that we can
distinguish this dead window from any live window. Live leaf
windows will have buffer set, and combination windows will have