diff options
| author | Stefan Monnier | 2013-11-28 17:43:09 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2013-11-28 17:43:09 -0500 |
| commit | 655ab9a380068143cfb9a31d01488e83676d81c1 (patch) | |
| tree | c703f4b96ca26edb6200cd08d6415fb6ece04560 /src/buffer.c | |
| parent | 698c0f24f170025470f3dcda51c11290062d78c4 (diff) | |
| download | emacs-655ab9a380068143cfb9a31d01488e83676d81c1.tar.gz emacs-655ab9a380068143cfb9a31d01488e83676d81c1.zip | |
Refine redisplay optimizations to only redisplay *some* frames/windows
rather than all of them.
* src/xdisp.c (REDISPLAY_SOME): New constant.
(redisplay_other_windows, wset_redisplay, fset_redisplay)
(bset_redisplay, bset_update_mode_line): New functions.
(message_dolog): Use bset_redisplay.
(clear_garbaged_frames): Use fset_redisplay.
(echo_area_display): Use wset_redisplay.
(buffer_shared_and_changed): Remove.
(prepare_menu_bars): Call Vpre_redisplay_function before updating
frame titles. Compute the actual set of windows redisplayed.
Don't update frame titles and menu bars for frames that don't need to
be redisplayed.
(propagate_buffer_redisplay): New function.
(AINC): New macro.
(redisplay_internal): Use it. Be more selective in the set of windows
we redisplay. Propagate windows_or_buffers_changed to
update_mode_lines a bit later to simplify the code.
(mark_window_display_accurate_1): Reset window and buffer's
`redisplay' flag.
(redisplay_window): Do nothing if neither the window nor the buffer nor
the frame needs redisplay.
* src/window.h (struct window): Add `redisplay' field.
(wset_redisplay, fset_redisplay, bset_redisplay, bset_update_mode_line)
(redisplay_other_windows, window_list): New declarations.
* src/window.c (select_window, Fset_window_start): Use wset_redisplay.
(window_list): Not static any more.
(grow_mini_window, shrink_mini_window): Use fset_redisplay.
* src/minibuf.c (read_minibuf_unwind): Don't redisplay everything.
* src/insdel.c (prepare_to_modify_buffer_1): Use bset_redisplay.
* src/frame.c (Fmake_frame_visible): Don't redisplay everything.
* src/frame.h (struct frame): Add `redisplay' field.
Move `external_menu_bar' bitfield next to other bit-fields.
(SET_FRAME_GARBAGED): Use fset_redisplay.
(SET_FRAME_VISIBLE): Don't garbage the frame;
Use redisplay_other_windows.
* src/buffer.h (struct buffer): Add `redisplay' field.
* src/buffer.c (Fforce_mode_line_update): Pay attention to the `all' flag.
(modify_overlay): Use bset_redisplay.
* src/alloc.c (gc_sweep): Don't unmark strings while sweeping symbols.
* lisp/doc-view.el (doc-view-goto-page): Update mode-line.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/buffer.c b/src/buffer.c index 61b685ea5c5..b40dc8cb3b7 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1336,10 +1336,16 @@ header lines. This function also forces recomputation of the | |||
| 1336 | menu bar menus and the frame title. */) | 1336 | menu bar menus and the frame title. */) |
| 1337 | (Lisp_Object all) | 1337 | (Lisp_Object all) |
| 1338 | { | 1338 | { |
| 1339 | if (!NILP (all) || buffer_window_count (current_buffer)) | 1339 | if (!NILP (all)) |
| 1340 | { | 1340 | { |
| 1341 | update_mode_lines = 10; | 1341 | update_mode_lines = 10; |
| 1342 | current_buffer->prevent_redisplay_optimizations_p = 1; | 1342 | /* FIXME: This can't be right. */ |
| 1343 | current_buffer->prevent_redisplay_optimizations_p = true; | ||
| 1344 | } | ||
| 1345 | else if (buffer_window_count (current_buffer)) | ||
| 1346 | { | ||
| 1347 | bset_update_mode_line (current_buffer); | ||
| 1348 | current_buffer->prevent_redisplay_optimizations_p = true; | ||
| 1343 | } | 1349 | } |
| 1344 | return all; | 1350 | return all; |
| 1345 | } | 1351 | } |
| @@ -3895,17 +3901,7 @@ modify_overlay (struct buffer *buf, ptrdiff_t start, ptrdiff_t end) | |||
| 3895 | 3901 | ||
| 3896 | BUF_COMPUTE_UNCHANGED (buf, start, end); | 3902 | BUF_COMPUTE_UNCHANGED (buf, start, end); |
| 3897 | 3903 | ||
| 3898 | /* If BUF is visible, consider updating the display if ... */ | 3904 | bset_redisplay (buf); |
| 3899 | if (buffer_window_count (buf) > 0) | ||
| 3900 | { | ||
| 3901 | /* ... it's visible in other window than selected, */ | ||
| 3902 | if (buf != XBUFFER (XWINDOW (selected_window)->contents)) | ||
| 3903 | windows_or_buffers_changed = 11; | ||
| 3904 | /* ... or if we modify an overlay at the end of the buffer | ||
| 3905 | and so we cannot be sure that window end is still valid. */ | ||
| 3906 | else if (end >= ZV && start <= ZV) | ||
| 3907 | windows_or_buffers_changed = 12; | ||
| 3908 | } | ||
| 3909 | 3905 | ||
| 3910 | ++BUF_OVERLAY_MODIFF (buf); | 3906 | ++BUF_OVERLAY_MODIFF (buf); |
| 3911 | } | 3907 | } |