diff options
| author | Stefan Monnier | 2013-12-04 13:46:47 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2013-12-04 13:46:47 -0500 |
| commit | 5961ad6cd28bd92d171949a03f362f069da82dec (patch) | |
| tree | 398e2b6adab82ed195ce82fc785a00a7b45b13da /src/window.c | |
| parent | ad82612405604b7d20d86fe6b3283f91bee5e60a (diff) | |
| download | emacs-5961ad6cd28bd92d171949a03f362f069da82dec.tar.gz emacs-5961ad6cd28bd92d171949a03f362f069da82dec.zip | |
* src/window.c (window_scroll): Mark window for redisplay.
(scroll_command, Fscroll_other_window): Don't cause redisplay now that
window_scroll takes care of it.
(Fset_window_point, Fdelete_other_windows_internal)
(set_window_buffer, Fwindow_resize_apply, resize_frame_windows)
(Fsplit_window_internal, Fdelete_window_internal)
(Fresize_mini_window_internal, Fset_window_configuration)
(apply_window_adjustment): Use fset_redisplay and wset_redisplay to
cause redisplay instead of forcing a complete redisplay.
* src/xdisp.c (wset_redisplay): Don't set windows_or_buffers_changed if
we're only affecting the selected_window.
Fixes: debbugs:16034
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/window.c b/src/window.c index b7d4502e3ec..9a943129984 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1683,7 +1683,7 @@ Return POS. */) | |||
| 1683 | set_marker_restricted (w->pointm, pos, w->contents); | 1683 | set_marker_restricted (w->pointm, pos, w->contents); |
| 1684 | /* We have to make sure that redisplay updates the window to show | 1684 | /* We have to make sure that redisplay updates the window to show |
| 1685 | the new value of point. */ | 1685 | the new value of point. */ |
| 1686 | windows_or_buffers_changed = 25; | 1686 | wset_redisplay (w); |
| 1687 | } | 1687 | } |
| 1688 | 1688 | ||
| 1689 | return pos; | 1689 | return pos; |
| @@ -1706,8 +1706,7 @@ overriding motion of point in order to display at this exact start. */) | |||
| 1706 | w->update_mode_line = 1; | 1706 | w->update_mode_line = 1; |
| 1707 | /* Bug#15957. */ | 1707 | /* Bug#15957. */ |
| 1708 | w->window_end_valid = 0; | 1708 | w->window_end_valid = 0; |
| 1709 | if (w != XWINDOW (selected_window)) | 1709 | wset_redisplay (w); |
| 1710 | wset_redisplay (w); | ||
| 1711 | 1710 | ||
| 1712 | return pos; | 1711 | return pos; |
| 1713 | } | 1712 | } |
| @@ -2979,7 +2978,7 @@ window-start value is reasonable when this function is called. */) | |||
| 2979 | } | 2978 | } |
| 2980 | free_window_matrices (r); | 2979 | free_window_matrices (r); |
| 2981 | 2980 | ||
| 2982 | windows_or_buffers_changed = 27; | 2981 | fset_redisplay (f); |
| 2983 | Vwindow_list = Qnil; | 2982 | Vwindow_list = Qnil; |
| 2984 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; | 2983 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; |
| 2985 | resize_failed = 0; | 2984 | resize_failed = 0; |
| @@ -3364,7 +3363,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, | |||
| 3364 | } | 3363 | } |
| 3365 | /* Maybe we could move this into the `if' but it's not obviously safe and | 3364 | /* Maybe we could move this into the `if' but it's not obviously safe and |
| 3366 | I doubt it's worth the trouble. */ | 3365 | I doubt it's worth the trouble. */ |
| 3367 | windows_or_buffers_changed = 28; | 3366 | wset_redisplay (w); |
| 3368 | 3367 | ||
| 3369 | /* We must select BUFFER for running the window-scroll-functions. */ | 3368 | /* We must select BUFFER for running the window-scroll-functions. */ |
| 3370 | /* We can't check ! NILP (Vwindow_scroll_functions) here | 3369 | /* We can't check ! NILP (Vwindow_scroll_functions) here |
| @@ -3970,7 +3969,7 @@ be applied on the Elisp level. */) | |||
| 3970 | block_input (); | 3969 | block_input (); |
| 3971 | window_resize_apply (r, horflag); | 3970 | window_resize_apply (r, horflag); |
| 3972 | 3971 | ||
| 3973 | windows_or_buffers_changed = 30; | 3972 | fset_redisplay (f); |
| 3974 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; | 3973 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; |
| 3975 | 3974 | ||
| 3976 | adjust_frame_glyphs (f); | 3975 | adjust_frame_glyphs (f); |
| @@ -4148,7 +4147,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) | |||
| 4148 | } | 4147 | } |
| 4149 | } | 4148 | } |
| 4150 | 4149 | ||
| 4151 | windows_or_buffers_changed = 31; | 4150 | fset_redisplay (f); |
| 4152 | } | 4151 | } |
| 4153 | 4152 | ||
| 4154 | 4153 | ||
| @@ -4250,7 +4249,7 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 4250 | error ("Sum of sizes of old and new window don't fit"); | 4249 | error ("Sum of sizes of old and new window don't fit"); |
| 4251 | } | 4250 | } |
| 4252 | 4251 | ||
| 4253 | /* This is our point of no return. */ | 4252 | /* This is our point of no return. */ |
| 4254 | if (combination_limit) | 4253 | if (combination_limit) |
| 4255 | { | 4254 | { |
| 4256 | /* Save the old value of o->normal_cols/lines. It gets corrupted | 4255 | /* Save the old value of o->normal_cols/lines. It gets corrupted |
| @@ -4275,7 +4274,7 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 4275 | else | 4274 | else |
| 4276 | p = XWINDOW (o->parent); | 4275 | p = XWINDOW (o->parent); |
| 4277 | 4276 | ||
| 4278 | windows_or_buffers_changed = 32; | 4277 | fset_redisplay (f); |
| 4279 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; | 4278 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; |
| 4280 | new = make_window (); | 4279 | new = make_window (); |
| 4281 | n = XWINDOW (new); | 4280 | n = XWINDOW (new); |
| @@ -4439,7 +4438,7 @@ Signal an error when WINDOW is the only window on its frame. */) | |||
| 4439 | hlinfo->mouse_face_window = Qnil; | 4438 | hlinfo->mouse_face_window = Qnil; |
| 4440 | } | 4439 | } |
| 4441 | 4440 | ||
| 4442 | windows_or_buffers_changed = 33; | 4441 | fset_redisplay (f); |
| 4443 | Vwindow_list = Qnil; | 4442 | Vwindow_list = Qnil; |
| 4444 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; | 4443 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; |
| 4445 | 4444 | ||
| @@ -4662,7 +4661,7 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini | |||
| 4662 | w->pixel_height = XFASTINT (w->new_pixel); | 4661 | w->pixel_height = XFASTINT (w->new_pixel); |
| 4663 | w->pixel_top = r->pixel_top + r->pixel_height; | 4662 | w->pixel_top = r->pixel_top + r->pixel_height; |
| 4664 | 4663 | ||
| 4665 | windows_or_buffers_changed = 36; | 4664 | fset_redisplay (f); |
| 4666 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; | 4665 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; |
| 4667 | adjust_frame_glyphs (f); | 4666 | adjust_frame_glyphs (f); |
| 4668 | unblock_input (); | 4667 | unblock_input (); |
| @@ -4732,6 +4731,8 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool whole, int noerror) | |||
| 4732 | immediate_quit = 1; | 4731 | immediate_quit = 1; |
| 4733 | n = clip_to_bounds (INT_MIN, n, INT_MAX); | 4732 | n = clip_to_bounds (INT_MIN, n, INT_MAX); |
| 4734 | 4733 | ||
| 4734 | wset_redisplay (XWINDOW (window)); | ||
| 4735 | |||
| 4735 | /* If we must, use the pixel-based version which is much slower than | 4736 | /* If we must, use the pixel-based version which is much slower than |
| 4736 | the line-based one but can handle varying line heights. */ | 4737 | the line-based one but can handle varying line heights. */ |
| 4737 | if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame))) | 4738 | if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame))) |
| @@ -5283,9 +5284,6 @@ scroll_command (Lisp_Object n, int direction) | |||
| 5283 | { | 5284 | { |
| 5284 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | 5285 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); |
| 5285 | Fset_buffer (XWINDOW (selected_window)->contents); | 5286 | Fset_buffer (XWINDOW (selected_window)->contents); |
| 5286 | |||
| 5287 | /* Make redisplay consider other windows than just selected_window. */ | ||
| 5288 | windows_or_buffers_changed = 37; | ||
| 5289 | } | 5287 | } |
| 5290 | 5288 | ||
| 5291 | if (NILP (n)) | 5289 | if (NILP (n)) |
| @@ -5395,7 +5393,6 @@ specifies the window to scroll. This takes precedence over | |||
| 5395 | 5393 | ||
| 5396 | /* Don't screw up if window_scroll gets an error. */ | 5394 | /* Don't screw up if window_scroll gets an error. */ |
| 5397 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | 5395 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); |
| 5398 | windows_or_buffers_changed = 38; | ||
| 5399 | 5396 | ||
| 5400 | Fset_buffer (w->contents); | 5397 | Fset_buffer (w->contents); |
| 5401 | SET_PT_BOTH (marker_position (w->pointm), marker_byte_position (w->pointm)); | 5398 | SET_PT_BOTH (marker_position (w->pointm), marker_byte_position (w->pointm)); |
| @@ -6052,7 +6049,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 6052 | BUF_PT_BYTE (XBUFFER (w->contents))); | 6049 | BUF_PT_BYTE (XBUFFER (w->contents))); |
| 6053 | } | 6050 | } |
| 6054 | 6051 | ||
| 6055 | windows_or_buffers_changed = 39; | 6052 | fset_redisplay (f); |
| 6056 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; | 6053 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; |
| 6057 | 6054 | ||
| 6058 | /* Problem: Freeing all matrices and later allocating them again | 6055 | /* Problem: Freeing all matrices and later allocating them again |
| @@ -6597,7 +6594,7 @@ apply_window_adjustment (struct window *w) | |||
| 6597 | adjust_window_margins (w); | 6594 | adjust_window_margins (w); |
| 6598 | clear_glyph_matrix (w->current_matrix); | 6595 | clear_glyph_matrix (w->current_matrix); |
| 6599 | w->window_end_valid = 0; | 6596 | w->window_end_valid = 0; |
| 6600 | windows_or_buffers_changed = 40; | 6597 | wset_redisplay (w); |
| 6601 | adjust_frame_glyphs (XFRAME (WINDOW_FRAME (w))); | 6598 | adjust_frame_glyphs (XFRAME (WINDOW_FRAME (w))); |
| 6602 | } | 6599 | } |
| 6603 | 6600 | ||