bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#22404: 25.1.50; Forcing `window-scroll-functions` to run.


From: Eli Zaretskii
Subject: bug#22404: 25.1.50; Forcing `window-scroll-functions` to run.
Date: Tue, 02 Feb 2016 18:34:58 +0200

> Date:  Mon, 01 Feb 2016 05:18:02 -0800
> From:  Keith David Bershatsky <esq@lawlist.com>
> Cc:  22404@debbugs.gnu.org
> 
> The four (4) values that I am most interested in are:
> 
>   1.  window-start
> 
>   2.  window-end
> 
>   3.  Point at the beginning of the line containing window-start.
> 
>   4.  Point at the end of the line containing window-end.

These are available from Lisp, so there seems to be no need to pass
them as arguments to the hook, right?

> Although my proposed usage of the `post-redisplay-hook` will not be to alter 
> buffer (i.e., I'm just adding overlays), other people who may use this new 
> hook in the future may be modifying the buffer content -- e.g., 
> adding/removing fonts, adding/removing text, moving the cursor, etc.

If those users need this new hook, they can always invoke redisplay
explicitly at the end of their code, right?

> The `window-scroll-functions` hook is strategically placed at three locations 
> of `xdisp.c`, and some of those areas are revisited when things have changed 
> since the first pass -- e.g., continuation line at the beginning of the 
> window, or cursor is partially visible at the bottom of the window.

But the fact they run in the middle of the redisplay cycle is exactly
the source of the problems we are trying to solve!

> If the `post-redisplay-hook` runs too late in time to receive any checks 
> regarding cursor position and so forth, some users may be surprised when 
> their cursor ends up below the visible screen at the conclusion of redisplay 
> -- e.g., because they added text or increased a font size that pushed the 
> cursor further down below.

Calling redisplay explicitly should resolve all those issues.





reply via email to

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