comparison src/window.c @ 45835:aab759361c24

(Fset_window_configuration): Explicitly preserve the point value that new_current_buffer had at the start.
author Richard M. Stallman <rms@gnu.org>
date Sat, 15 Jun 2002 14:20:52 +0000
parents 6e2471fb2c1c
children 8108a2dd551c
comparison
equal deleted inserted replaced
45834:25a6099362fe 45835:aab759361c24
4939 register struct save_window_data *data; 4939 register struct save_window_data *data;
4940 struct Lisp_Vector *saved_windows; 4940 struct Lisp_Vector *saved_windows;
4941 Lisp_Object new_current_buffer; 4941 Lisp_Object new_current_buffer;
4942 Lisp_Object frame; 4942 Lisp_Object frame;
4943 FRAME_PTR f; 4943 FRAME_PTR f;
4944 int old_point = -1;
4944 4945
4945 while (!WINDOW_CONFIGURATIONP (configuration)) 4946 while (!WINDOW_CONFIGURATIONP (configuration))
4946 wrong_type_argument (Qwindow_configuration_p, configuration); 4947 wrong_type_argument (Qwindow_configuration_p, configuration);
4947 4948
4948 data = (struct save_window_data *) XVECTOR (configuration); 4949 data = (struct save_window_data *) XVECTOR (configuration);
4949 saved_windows = XVECTOR (data->saved_windows); 4950 saved_windows = XVECTOR (data->saved_windows);
4950 4951
4951 new_current_buffer = data->current_buffer; 4952 new_current_buffer = data->current_buffer;
4952 if (NILP (XBUFFER (new_current_buffer)->name)) 4953 if (NILP (XBUFFER (new_current_buffer)->name))
4953 new_current_buffer = Qnil; 4954 new_current_buffer = Qnil;
4955 else
4956 old_point = BUF_PT (XBUFFER (new_current_buffer));
4954 4957
4955 frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; 4958 frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
4956 f = XFRAME (frame); 4959 f = XFRAME (frame);
4957 4960
4958 /* If f is a dead frame, don't bother rebuilding its window tree. 4961 /* If f is a dead frame, don't bother rebuilding its window tree.
5136 } 5139 }
5137 5140
5138 FRAME_ROOT_WINDOW (f) = data->root_window; 5141 FRAME_ROOT_WINDOW (f) = data->root_window;
5139 /* Prevent "swapping out point" in the old selected window 5142 /* Prevent "swapping out point" in the old selected window
5140 using the buffer that has been restored into it. 5143 using the buffer that has been restored into it.
5141 That swapping out has already been done, 5144 Use the point value from the beginning of this function
5142 near the beginning of this function. */ 5145 since unshow_buffer (called from delete_all_subwindows)
5146 could have altered it. */
5143 selected_window = Qnil; 5147 selected_window = Qnil;
5144 if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)) 5148 if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer))
5145 set_marker_restricted (XWINDOW (data->current_window)->pointm, 5149 set_marker_restricted (XWINDOW (data->current_window)->pointm,
5146 make_number (BUF_PT (XBUFFER (XWINDOW (data->current_window)->buffer))), 5150 old_point,
5147 XWINDOW (data->current_window)->buffer); 5151 XWINDOW (data->current_window)->buffer);
5148 5152
5149 Fselect_window (data->current_window); 5153 Fselect_window (data->current_window);
5150 XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window 5154 XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window
5151 = selected_window; 5155 = selected_window;