# HG changeset patch # User Richard M. Stallman # Date 868253521 0 # Node ID 1dc4d7e374d59408a36c3df78943dd85dabac25e # Parent 52a3dec2b6cc31d61a34620023bc5d86e0aecf7d Include blockinput.h. (Fset_window_configuration): Block input around frobbing the frame. Preseve point in the current buffer if we do not switch to a different one. diff -r 52a3dec2b6cc -r 1dc4d7e374d5 src/window.c --- a/src/window.c Mon Jul 07 04:48:15 1997 +0000 +++ b/src/window.c Mon Jul 07 05:32:01 1997 +0000 @@ -29,6 +29,7 @@ #include "termchar.h" #include "disptab.h" #include "keyboard.h" +#include "blockinput.h" Lisp_Object Qwindowp, Qwindow_live_p; @@ -3213,6 +3214,7 @@ Lisp_Object new_current_buffer; Lisp_Object frame; FRAME_PTR f; + int old_point = -1; while (!WINDOW_CONFIGURATIONP (configuration)) { @@ -3226,6 +3228,11 @@ new_current_buffer = data->current_buffer; if (NILP (XBUFFER (new_current_buffer)->name)) new_current_buffer = Qnil; + else + { + if (XBUFFER (new_current_buffer) == current_buffer) + old_point = PT; + } frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; f = XFRAME (frame); @@ -3246,6 +3253,10 @@ int previous_frame_width = FRAME_WIDTH (f); int previous_frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f); + /* The mouse highlighting code could get screwed up + if it runs during this. */ + BLOCK_INPUT; + if (XFASTINT (data->frame_height) != previous_frame_height || XFASTINT (data->frame_width) != previous_frame_width) change_frame_size (f, data->frame_height, data->frame_width, 0, 0); @@ -3401,6 +3412,8 @@ if (previous_frame_menu_bar_lines != FRAME_MENU_BAR_LINES (f)) x_set_menu_bar_lines (f, previous_frame_menu_bar_lines, 0); #endif + + UNBLOCK_INPUT; } /* Restore the minimum heights recorded in the configuration. */ @@ -3416,7 +3429,15 @@ do_switch_frame (data->selected_frame, Qnil, 0); if (!NILP (new_current_buffer)) - Fset_buffer (new_current_buffer); + { + Fset_buffer (new_current_buffer); + + /* If the buffer that is current now is the same + that was current before setting the window configuration, + don't alter its PT. */ + if (old_point >= 0) + SET_PT (old_point); + } Vminibuf_scroll_window = data->minibuf_scroll_window;