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


View this message in rfc822 format

From: Keith David Bershatsky <esq <at> lawlist.com>
To: Eli Zaretskii <eliz <at> gnu.org>,Michael Heerdegen <eliz <at> gnu.org>
Cc: 22404 <at> debbugs.gnu.org
Subject: bug#22404: 25.1.50; Forcing `window-scroll-functions` to run.
Date: Fri, 29 Jan 2016 07:54:08 -0800
[Message part 1 (text/plain, inline)]
In reading the comments in `xdisp.c`, there is a lot of mention about checking to see if the function that ran changed `window-start` and whether the cursor is still visible.  In my own tests over the past few days, I created something just like `post-redisplay-hook` that runs towards the end of redisplay.  I felt that my own feeble attempt to create the equivalent of the `post-redisplay-hook` had no checking built-in (due to lack knowledge / experience on my part).

So, I love the idea of a `post-redisplay-hook`, but think there probably needs to be some type of check to see whether the function that ran from it did some things that require certain recalculations -- e.g., maybe cursor was moved and is no longer partially or fully visible (there is even a setting I discovered where a user can decide that a partially visible cursor is just fine), maybe some text was inserted prior to window-start (which means the prior value is outdated), etc.

Sorry that I didn't understand your previous comments about the `pre-command-hook` potentially being a substitute for the contemplated `post-redisplay-hook`.  Michael is correct -- the goal is generally to have the screen looking perfectly once redisplay concludes and the `pre-command-hook` (after the fact) can't accomplish that goal.  When switching windows, the `pre-command-hook` will also have the wrong window in mind -- the correct window/buffer needs to be determined after the main command finishes.

Attached is an example of what I have been using for the past few days while I continue my ongoing tinkering -- it creates a new animal just like `window-scroll-functions` but with a different name.

Keith

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

At Fri, 29 Jan 2016 16:37:16 +0200,
Eli Zaretskii wrote:
> 
> > From: Michael Heerdegen <michael_heerdegen <at> web.de>
> > Cc: Keith David Bershatsky <esq <at> lawlist.com>,  22404 <at> debbugs.gnu.org
> > Date: Fri, 29 Jan 2016 13:00:42 +0100
> > 
> > Anyway, using pre-command-hook is too late for us: it's not executed
> > unless the next input arrives, so you have to hit a key until
> > decorations or whatever get updated.
> 
> Then maybe we need a post-redisplay-hook.

[wsf.diff (application/diff, attachment)]

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

Previous Next


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