]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #14170 with window-end returning a stale value.
authorEli Zaretskii <eliz@gnu.org>
Thu, 11 Apr 2013 16:06:47 +0000 (19:06 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 11 Apr 2013 16:06:47 +0000 (19:06 +0300)
This bug was introduced in 2012-10-15T09:03:56Z!rudalics@gmx.at
while solving bug #12600.

 src/window.c (Fwindow_end): Test more flags, including the buffer's
 last_overlay_modified flag, to determine whether the window's
 display is really up-to-date.  Prevents the function from
 returning a stale value.
 (Fwindow_line_height): Fix the test for up-to-date-ness of the
 current matrix.

src/ChangeLog
src/window.c

index ff6b9508d62f63f84d7e9548c9eddca3f69ad1b6..7f4c59b8eb44e00014db1609c8030d42cb132939 100644 (file)
@@ -1,3 +1,12 @@
+2013-04-11  Eli Zaretskii  <eliz@gnu.org>
+
+       * window.c (Fwindow_end): Test more flags, including the buffer's
+       last_overlay_modified flag, to determine whether the window's
+       display is really up-to-date.  Prevents the function from
+       returning a stale value.  (Bug#14170)
+       (Fwindow_line_height): Fix the test for up-to-date-ness of the
+       current matrix.
+
 2013-04-10  Eli Zaretskii  <eliz@gnu.org>
 
        * frame.c (do_switch_frame): Mark the TTY frame we switch to as
index 2ddf742be993ba6df18faca26115c5a93053161f..fe5b5ec1e6ee54a1260e025d1cbd0a96800c8ba5 100644 (file)
@@ -1493,7 +1493,12 @@ if it isn't already recorded.  */)
   b = XBUFFER (buf);
 
   if (! NILP (update)
-      && (windows_or_buffers_changed || !w->window_end_valid)
+      && (windows_or_buffers_changed
+         || !w->window_end_valid
+         || b->clip_changed
+         || b->prevent_redisplay_optimizations_p
+         || w->last_modified < BUF_MODIFF (b)
+         || w->last_overlay_modified < BUF_OVERLAY_MODIFF (b))
       && !noninteractive)
     {
       struct text_pos startp;
@@ -1702,8 +1707,9 @@ Return nil if window display is not up-to-date.  In that case, use
 
   /* Fail if current matrix is not up-to-date.  */
   if (!w->window_end_valid
-      || current_buffer->clip_changed
-      || current_buffer->prevent_redisplay_optimizations_p
+      || windows_or_buffers_changed
+      || b->clip_changed
+      || b->prevent_redisplay_optimizations_p
       || w->last_modified < BUF_MODIFF (b)
       || w->last_overlay_modified < BUF_OVERLAY_MODIFF (b))
     return Qnil;