diff options
| author | Richard M. Stallman | 1997-07-07 05:32:01 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-07-07 05:32:01 +0000 |
| commit | d2b352346d13c8de72cc2a1ee578286f22d5bb5b (patch) | |
| tree | b02d36b377d8f6ce1375654a51496a1c8a9c41a5 /src/window.c | |
| parent | 43462d5b7f48995baeed9f95c55a9cca75e0f461 (diff) | |
| download | emacs-d2b352346d13c8de72cc2a1ee578286f22d5bb5b.tar.gz emacs-d2b352346d13c8de72cc2a1ee578286f22d5bb5b.zip | |
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.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c index 59f49f92530..1aee0ec99f3 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 29 | #include "termchar.h" | 29 | #include "termchar.h" |
| 30 | #include "disptab.h" | 30 | #include "disptab.h" |
| 31 | #include "keyboard.h" | 31 | #include "keyboard.h" |
| 32 | #include "blockinput.h" | ||
| 32 | 33 | ||
| 33 | Lisp_Object Qwindowp, Qwindow_live_p; | 34 | Lisp_Object Qwindowp, Qwindow_live_p; |
| 34 | 35 | ||
| @@ -3213,6 +3214,7 @@ by `current-window-configuration' (which see).") | |||
| 3213 | Lisp_Object new_current_buffer; | 3214 | Lisp_Object new_current_buffer; |
| 3214 | Lisp_Object frame; | 3215 | Lisp_Object frame; |
| 3215 | FRAME_PTR f; | 3216 | FRAME_PTR f; |
| 3217 | int old_point = -1; | ||
| 3216 | 3218 | ||
| 3217 | while (!WINDOW_CONFIGURATIONP (configuration)) | 3219 | while (!WINDOW_CONFIGURATIONP (configuration)) |
| 3218 | { | 3220 | { |
| @@ -3226,6 +3228,11 @@ by `current-window-configuration' (which see).") | |||
| 3226 | new_current_buffer = data->current_buffer; | 3228 | new_current_buffer = data->current_buffer; |
| 3227 | if (NILP (XBUFFER (new_current_buffer)->name)) | 3229 | if (NILP (XBUFFER (new_current_buffer)->name)) |
| 3228 | new_current_buffer = Qnil; | 3230 | new_current_buffer = Qnil; |
| 3231 | else | ||
| 3232 | { | ||
| 3233 | if (XBUFFER (new_current_buffer) == current_buffer) | ||
| 3234 | old_point = PT; | ||
| 3235 | } | ||
| 3229 | 3236 | ||
| 3230 | frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; | 3237 | frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; |
| 3231 | f = XFRAME (frame); | 3238 | f = XFRAME (frame); |
| @@ -3246,6 +3253,10 @@ by `current-window-configuration' (which see).") | |||
| 3246 | int previous_frame_width = FRAME_WIDTH (f); | 3253 | int previous_frame_width = FRAME_WIDTH (f); |
| 3247 | int previous_frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f); | 3254 | int previous_frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f); |
| 3248 | 3255 | ||
| 3256 | /* The mouse highlighting code could get screwed up | ||
| 3257 | if it runs during this. */ | ||
| 3258 | BLOCK_INPUT; | ||
| 3259 | |||
| 3249 | if (XFASTINT (data->frame_height) != previous_frame_height | 3260 | if (XFASTINT (data->frame_height) != previous_frame_height |
| 3250 | || XFASTINT (data->frame_width) != previous_frame_width) | 3261 | || XFASTINT (data->frame_width) != previous_frame_width) |
| 3251 | change_frame_size (f, data->frame_height, data->frame_width, 0, 0); | 3262 | change_frame_size (f, data->frame_height, data->frame_width, 0, 0); |
| @@ -3401,6 +3412,8 @@ by `current-window-configuration' (which see).") | |||
| 3401 | if (previous_frame_menu_bar_lines != FRAME_MENU_BAR_LINES (f)) | 3412 | if (previous_frame_menu_bar_lines != FRAME_MENU_BAR_LINES (f)) |
| 3402 | x_set_menu_bar_lines (f, previous_frame_menu_bar_lines, 0); | 3413 | x_set_menu_bar_lines (f, previous_frame_menu_bar_lines, 0); |
| 3403 | #endif | 3414 | #endif |
| 3415 | |||
| 3416 | UNBLOCK_INPUT; | ||
| 3404 | } | 3417 | } |
| 3405 | 3418 | ||
| 3406 | /* Restore the minimum heights recorded in the configuration. */ | 3419 | /* Restore the minimum heights recorded in the configuration. */ |
| @@ -3416,7 +3429,15 @@ by `current-window-configuration' (which see).") | |||
| 3416 | do_switch_frame (data->selected_frame, Qnil, 0); | 3429 | do_switch_frame (data->selected_frame, Qnil, 0); |
| 3417 | 3430 | ||
| 3418 | if (!NILP (new_current_buffer)) | 3431 | if (!NILP (new_current_buffer)) |
| 3419 | Fset_buffer (new_current_buffer); | 3432 | { |
| 3433 | Fset_buffer (new_current_buffer); | ||
| 3434 | |||
| 3435 | /* If the buffer that is current now is the same | ||
| 3436 | that was current before setting the window configuration, | ||
| 3437 | don't alter its PT. */ | ||
| 3438 | if (old_point >= 0) | ||
| 3439 | SET_PT (old_point); | ||
| 3440 | } | ||
| 3420 | 3441 | ||
| 3421 | Vminibuf_scroll_window = data->minibuf_scroll_window; | 3442 | Vminibuf_scroll_window = data->minibuf_scroll_window; |
| 3422 | 3443 | ||