comparison src/window.c @ 16068:b19129a8c644

(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.
author Richard M. Stallman <rms@gnu.org>
date Mon, 02 Sep 1996 05:13:11 +0000
parents ccf489f8596e
children e3a834653117
comparison
equal deleted inserted replaced
16067:5c9f298c9875 16068:b19129a8c644
689 Lisp_Object buf; 689 Lisp_Object buf;
690 690
691 buf = w->buffer; 691 buf = w->buffer;
692 if (XBUFFER (buf) != XMARKER (w->pointm)->buffer) 692 if (XBUFFER (buf) != XMARKER (w->pointm)->buffer)
693 abort (); 693 abort ();
694
695 if (w == XWINDOW (XBUFFER (buf)->last_selected_window))
696 XBUFFER (buf)->last_selected_window = Qnil;
694 697
695 #if 0 698 #if 0
696 if (w == XWINDOW (selected_window) 699 if (w == XWINDOW (selected_window)
697 || ! EQ (buf, XWINDOW (selected_window)->buffer)) 700 || ! EQ (buf, XWINDOW (selected_window)->buffer))
698 /* Do this except when the selected window's buffer 701 /* Do this except when the selected window's buffer
1840 1843
1841 unshow_buffer (w); 1844 unshow_buffer (w);
1842 } 1845 }
1843 1846
1844 w->buffer = buffer; 1847 w->buffer = buffer;
1848
1849 if (EQ (window, selected_window))
1850 XBUFFER (w->buffer)->last_selected_window = window;
1851
1845 XSETFASTINT (w->window_end_pos, 0); 1852 XSETFASTINT (w->window_end_pos, 0);
1846 w->window_end_valid = Qnil; 1853 w->window_end_valid = Qnil;
1847 XSETFASTINT (w->hscroll, 0); 1854 XSETFASTINT (w->hscroll, 0);
1848 Fset_marker (w->pointm, 1855 Fset_marker (w->pointm,
1849 make_number (BUF_PT (XBUFFER (buffer))), 1856 make_number (BUF_PT (XBUFFER (buffer))),
1915 else 1922 else
1916 selected_frame->selected_window = window; 1923 selected_frame->selected_window = window;
1917 1924
1918 record_buffer (w->buffer); 1925 record_buffer (w->buffer);
1919 Fset_buffer (w->buffer); 1926 Fset_buffer (w->buffer);
1927
1928 XBUFFER (w->buffer)->last_selected_window = window;
1920 1929
1921 /* Go to the point recorded in the window. 1930 /* Go to the point recorded in the window.
1922 This is important when the buffer is in more 1931 This is important when the buffer is in more
1923 than one window. It also matters when 1932 than one window. It also matters when
1924 redisplay_window has altered point after scrolling, 1933 redisplay_window has altered point after scrolling,
3218 delete_all_subwindows (XWINDOW (w->vchild)); 3227 delete_all_subwindows (XWINDOW (w->vchild));
3219 if (!NILP (w->hchild)) 3228 if (!NILP (w->hchild))
3220 delete_all_subwindows (XWINDOW (w->hchild)); 3229 delete_all_subwindows (XWINDOW (w->hchild));
3221 3230
3222 w->height = w->buffer; /* See Fset_window_configuration for excuse. */ 3231 w->height = w->buffer; /* See Fset_window_configuration for excuse. */
3232
3233 if (!NILP (w->buffer))
3234 unshow_buffer (w);
3223 3235
3224 /* We set all three of these fields to nil, to make sure that we can 3236 /* We set all three of these fields to nil, to make sure that we can
3225 distinguish this dead window from any live window. Live leaf 3237 distinguish this dead window from any live window. Live leaf
3226 windows will have buffer set, and combination windows will have 3238 windows will have buffer set, and combination windows will have
3227 vchild or hchild set. */ 3239 vchild or hchild set. */