GNU bug report logs - #22404
25.1.50; Forcing `window-scroll-functions` to run.

Previous Next

Package: emacs;

Reported by: Keith David Bershatsky <esq <at> lawlist.com>

Date: Tue, 19 Jan 2016 05:50:01 UTC

Severity: wishlist

Found in version 25.1.50

Full log


Message #41 received at 22404 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Keith David Bershatsky <esq <at> lawlist.com>
Cc: 22404 <at> debbugs.gnu.org
Subject: Re: bug#22404: 25.1.50; Forcing `window-scroll-functions` to run.
Date: Thu, 21 Jan 2016 22:28:05 +0200
> Date:  Thu, 21 Jan 2016 11:54:30 -0800
> From:  Keith David Bershatsky <esq <at> lawlist.com>
> Cc:  22404 <at> debbugs.gnu.org
> 
> The calculations (primarily because of `vertical-motion`) are too costly time-wise to perform more than once during each command loop because it slows down performance.
> 
> If I run the calculations from the `post-command-hook`, I will have wasted precious time IF the `window-scroll-functions` hook will be running.  IF the `window-scroll-functions` hook will be running, then the `window-start` and `window-end` obtained from the `post-command-hook` will be wrong -- so there is no point using those PCH wrong numbers.
> 
> If I run the calculations from the INITIAL run of the `window-scroll-functions` hook, I will have wasted precious time IF the WSF hook will be running a SECOND time.  [WSF runs a SECOND time if point was PARTIALLY visible.]  IF the WSF will be running more than one time, then the INITIAL values for `window-start` and `window-end` will be wrong -- so there is no point using those WSF wrong numbers.  Instead, I have to wait until the LAST call on the WSF when the final correct values for `window-start` and `window-end` can be truly ascertained.
> 
> Without the benefit of feature request 22404, there are a couple of options that are not ideal.

What do you need from window-scroll-functions?  Only the correct
values of window-start and window-end?  Or something else?

The other thing I still don't understand is how forcing
window-scroll-functions to run could fix your problem or _avoiding_
extra calculations.  Where and under what conditions would you call
the function that forces Emacs to run window-scroll-functions?
Doesn't that waste processing in those cases where normally
window-scroll-functions didn't need to be run (because window-start
and window-end don't change)?  IOW, aren't you running those costly
calculations from window-scroll-functions?

Finally, wouldn't running from pre-command-hook solve the problem?
The values of window-start and window-end are known by then, and you
can record the old values to compare them against new, to know when
they change.  No?




This bug report was last modified 9 years and 97 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.