diff options
| author | Dmitry Antipov | 2013-08-07 14:32:08 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-08-07 14:32:08 +0400 |
| commit | 170da1ec691127471ecd118dccd79eec7c9f3699 (patch) | |
| tree | b21f37e99fdde63c2f6169c4728629ef2b302513 /src/window.c | |
| parent | 20940c206593a8e7bd4809348ff95a6f971c5528 (diff) | |
| download | emacs-170da1ec691127471ecd118dccd79eec7c9f3699.tar.gz emacs-170da1ec691127471ecd118dccd79eec7c9f3699.zip | |
Be more careful if selected window shows the buffer other than current,
use window_outdated only if this is not so. This change should also
address some weird issues discussed in Bug#13012.
* window.h (window_outdated): New prototype.
* window.c (window_outdated): Now here. Convert from static and
always assume window's buffer.
(Fwindow_end, Fwindow_line_height): Use it.
* xdisp.c (reconsider_clip_changes): Remove prototype, drop 2nd arg
and always assume window's buffer.
(redisplay_window): Adjust user.
(redisplay_internal): Call to reconsider_clip_change once and
check whether mode line should be updated only if selected window
shows current buffer.
(run_window_scroll_functions): Use eassert for debugging check.
(Fmove_point_visually, note_mouse_highlight): Use window_outdated.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c index 33d7dab7ec0..dff449072f5 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -239,6 +239,17 @@ wset_combination (struct window *w, bool horflag, Lisp_Object val) | |||
| 239 | w->horizontal = horflag; | 239 | w->horizontal = horflag; |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | /* Nonzero if leaf window W doesn't reflect the actual state | ||
| 243 | of displayed buffer due to its text or overlays change. */ | ||
| 244 | |||
| 245 | bool | ||
| 246 | window_outdated (struct window *w) | ||
| 247 | { | ||
| 248 | struct buffer *b = XBUFFER (w->contents); | ||
| 249 | return (w->last_modified < BUF_MODIFF (b) | ||
| 250 | || w->last_overlay_modified < BUF_OVERLAY_MODIFF (b)); | ||
| 251 | } | ||
| 252 | |||
| 242 | struct window * | 253 | struct window * |
| 243 | decode_live_window (register Lisp_Object window) | 254 | decode_live_window (register Lisp_Object window) |
| 244 | { | 255 | { |
| @@ -1506,8 +1517,7 @@ if it isn't already recorded. */) | |||
| 1506 | || !w->window_end_valid | 1517 | || !w->window_end_valid |
| 1507 | || b->clip_changed | 1518 | || b->clip_changed |
| 1508 | || b->prevent_redisplay_optimizations_p | 1519 | || b->prevent_redisplay_optimizations_p |
| 1509 | || w->last_modified < BUF_MODIFF (b) | 1520 | || window_outdated (w)) |
| 1510 | || w->last_overlay_modified < BUF_OVERLAY_MODIFF (b)) | ||
| 1511 | && !noninteractive) | 1521 | && !noninteractive) |
| 1512 | { | 1522 | { |
| 1513 | struct text_pos startp; | 1523 | struct text_pos startp; |
| @@ -1720,8 +1730,7 @@ Return nil if window display is not up-to-date. In that case, use | |||
| 1720 | || windows_or_buffers_changed | 1730 | || windows_or_buffers_changed |
| 1721 | || b->clip_changed | 1731 | || b->clip_changed |
| 1722 | || b->prevent_redisplay_optimizations_p | 1732 | || b->prevent_redisplay_optimizations_p |
| 1723 | || w->last_modified < BUF_MODIFF (b) | 1733 | || window_outdated (w)) |
| 1724 | || w->last_overlay_modified < BUF_OVERLAY_MODIFF (b)) | ||
| 1725 | return Qnil; | 1734 | return Qnil; |
| 1726 | 1735 | ||
| 1727 | if (NILP (line)) | 1736 | if (NILP (line)) |