return window_height_changed_p;
}
-/* True if the current buffer is shown in more than
+/* Nonzero if the current buffer is shown in more than
one window and was modified since last display. */
static int
return (buffer_shared > 1 && UNCHANGED_MODIFIED < MODIFF);
}
+/* Nonzero if W doesn't reflect the actual state of
+ current buffer due to its text or overlays change. */
+
+static int
+window_outdated (struct window *w)
+{
+ eassert (XBUFFER (w->buffer) == current_buffer);
+ return (w->last_modified < MODIFF
+ || w->last_overlay_modified < OVERLAY_MODIFF);
+}
+
/***********************************************************************
Mode Lines and Frame Titles
***********************************************************************/
int unchanged_p = 1;
/* If text or overlays have changed, see where. */
- if (w->last_modified < MODIFF
- || w->last_overlay_modified < OVERLAY_MODIFF)
+ if (window_outdated (w))
{
/* Gap in the line? */
if (GPT < start || Z - GPT < end)
if (!NILP (w->column_number_displayed)
/* This alternative quickly identifies a common case
where no change is needed. */
- && !(PT == w->last_point
- && w->last_modified >= MODIFF
- && w->last_overlay_modified >= OVERLAY_MODIFF)
+ && !(PT == w->last_point && !window_outdated (w))
&& (XFASTINT (w->column_number_displayed) != current_column ()))
w->update_mode_line = 1;
}
}
else if (EQ (selected_window, minibuf_window)
- && (current_buffer->clip_changed
- || w->last_modified < MODIFF
- || w->last_overlay_modified < OVERLAY_MODIFF)
+ && (current_buffer->clip_changed || window_outdated (w))
&& resize_mini_window (w, 0))
{
/* Resized active mini-window to fit the size of what it is
showing if its contents might have changed. */
must_finish = 1;
-/* FIXME: this causes all frames to be updated, which seems unnecessary
- since only the current frame needs to be considered. This function needs
- to be rewritten with two variables, consider_all_windows and
- consider_all_frames. */
+ /* FIXME: this causes all frames to be updated, which seems unnecessary
+ since only the current frame needs to be considered. This function
+ needs to be rewritten with two variables, consider_all_windows and
+ consider_all_frames. */
consider_all_windows_p = 1;
++windows_or_buffers_changed;
++update_mode_lines;
|| FETCH_BYTE (BYTEPOS (tlbufpos)) == '\n'))
/* Former continuation line has disappeared by becoming empty. */
goto cancel;
- else if (w->last_modified < MODIFF
- || w->last_overlay_modified < OVERLAY_MODIFF
- || MINI_WINDOW_P (w))
+ else if (window_outdated (w) || MINI_WINDOW_P (w))
{
/* We have to handle the case of continuation around a
wide-column character (see the comment in indent.c around
= (!NILP (w->window_end_valid)
&& !current_buffer->clip_changed
&& !current_buffer->prevent_redisplay_optimizations_p
- && w->last_modified >= MODIFF
- && w->last_overlay_modified >= OVERLAY_MODIFF);
+ && !window_outdated (w));
/* Run the window-bottom-change-functions
if it is possible that the text on the screen has changed
buffer_unchanged_p
= (!NILP (w->window_end_valid)
&& !current_buffer->clip_changed
- && w->last_modified >= MODIFF
- && w->last_overlay_modified >= OVERLAY_MODIFF);
+ && !window_outdated (w));
/* When windows_or_buffers_changed is non-zero, we can't rely on
the window end being valid, so set it to nil there. */
if (!NILP (w->column_number_displayed)
/* This alternative quickly identifies a common case
where no change is needed. */
- && !(PT == w->last_point
- && w->last_modified >= MODIFF
- && w->last_overlay_modified >= OVERLAY_MODIFF)
+ && !(PT == w->last_point && !window_outdated (w))
&& (XFASTINT (w->column_number_displayed) != current_column ()))
update_mode_line = 1;
&& (CHARPOS (startp) < ZV
/* Avoid starting at end of buffer. */
|| CHARPOS (startp) == BEGV
- || (w->last_modified >= MODIFF
- && w->last_overlay_modified >= OVERLAY_MODIFF)))
+ || !window_outdated (w)))
{
int d1, d2, d3, d4, d5, d6;