emacs-devel
[Top][All Lists]
Advanced

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

Re: Allowing point to be outside the window?


From: Eli Zaretskii
Subject: Re: Allowing point to be outside the window?
Date: Thu, 09 Dec 2021 12:02:10 +0200

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Thu, 09 Dec 2021 17:22:52 +0800
> 
> BTW, how would you recommend to determine inside redisplay whether the
> text before the start of the window has changed?

We already do that when needed:

  /* The position of the first and last character that has been changed.  */
  first_changed_charpos = BEG + BEG_UNCHANGED;
  last_changed_charpos  = Z - END_UNCHANGED;

  /* If window starts after a line end, and the last change is in
     front of that newline, then changes don't affect the display.
     This case happens with stealth-fontification.  Note that although
     the display is unchanged, glyph positions in the matrix have to
     be adjusted, of course.  */
  row = MATRIX_ROW (w->current_matrix, w->window_end_vpos);
  if (MATRIX_ROW_DISPLAYS_TEXT_P (row)
      && ((last_changed_charpos < CHARPOS (start)
           && CHARPOS (start) == BEGV)
          || (last_changed_charpos < CHARPOS (start) - 1
              && FETCH_BYTE (BYTEPOS (start) - 1) == '\n')))

The BEG_UNCHANGED and END_UNCHANGED positions are tracked by all the
functions that modify the buffer.



reply via email to

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