[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text Properties And Buffer Modification

From: martin rudalics
Subject: Re: Text Properties And Buffer Modification
Date: Thu, 06 Dec 2018 19:46:42 +0100

> The optimization I had in mind is try_window_id.  You will see there
> that this optimization is disabled if overlays were changed, but not
> if the buffer (including text properties) was changed.  you will also
> see there that buffer-modification tick is used there to update the
> unchanged text at beginning and end of the buffer when necessary.

This must be the

  if (w->last_overlay_modified != OVERLAY_MODIFF)
    GIVE_UP (200);

form.  I clearly missed that.

IIUC try_window_id is based on the idea that typing should be fast
(that is, cause no excessive redisplay) as long as it does not happen
within an overlay.  But why do we optimize changes of text properties
as well?  For historical reasons, I suppose.

> The other place where the buffer modification tick is used is in
> mark_window_display_accurate_1.  If we somehow disrupt that, we could
> have excess re-entries into redisplay, because Emacs might think some
> windows ae not yet up to date.

This is one of those I looked at and found no difference between
overlay and text changes.  Now the former of these

  w->last_modified = accurate_p ? BUF_MODIFF (b) : 0;
  w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF (b) : 0;

is checked by try_window_id as

  if (w->last_modified == 0)
    GIVE_UP (6);

and the latter is needed by the check I cited above.  But is there an
additioal twist?

> There's also a place in redisplay_internal where we set the
> update_mode_line flag of the selected window when that window's buffer
> was modified, and a similar use in window_buffer_changed.

These are to be expected.

Many thanks for the explanations, martin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]