all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 22404@debbugs.gnu.org
Subject: bug#22404: 25.1.50; Forcing `window-scroll-functions` to run.
Date: Tue, 02 Feb 2016 10:16:23 -0800	[thread overview]
Message-ID: <m2twlr9dvs.wl%esq@lawlist.com> (raw)
In-Reply-To: <m260yqdsp7.wl%esq@lawlist.com>

A forced redisplay every command loop would pose two (2) major problems as far as I am aware.  The first issue will be that an unfinished display will be visible to the user for a split second before it gets finished with whatever code follows the first visible redisplay -- this will be especially visible when moving to an entirely different location of the buffer (e.g., full screen up or full screen down).  The second issue will be a significant slow-down in performance that will be mostly visible to the user when using rapid-fire keystrokes, or simply moving the cursor with the arrow keys by holding the arrow key in any of the four directions.  A forced redisplay is something that should be used sparingly, but not every command loop.

The four (4) values I seek *may* be available via Lisp depending upon where the `post-redisplay-hook` is placed.  I'd be happy to run some tests once you have decided upon a proposed location for the hook.

Keith

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

At Tue, 02 Feb 2016 18:34:58 +0200,
Eli Zaretskii wrote:
> 
> > 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.





  parent reply	other threads:[~2016-02-02 18:16 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19  5:49 bug#22404: 25.1.50; Forcing `window-scroll-functions` to run Keith David Bershatsky
2016-01-19 17:50 ` Eli Zaretskii
2016-01-19 18:49 ` Keith David Bershatsky
2016-01-19 19:39   ` Eli Zaretskii
2016-01-19 18:53 ` John Wiegley
2016-01-19 19:26 ` Keith David Bershatsky
2016-01-19 20:35 ` Keith David Bershatsky
2016-01-20 13:34   ` Eli Zaretskii
2016-01-19 23:07 ` Keith David Bershatsky
2016-01-21  2:32 ` Keith David Bershatsky
2016-01-21 17:41   ` Eli Zaretskii
2016-01-21 19:54 ` Keith David Bershatsky
2016-01-21 20:28   ` Eli Zaretskii
2016-01-29 12:00     ` Michael Heerdegen
2016-01-29 14:37       ` Eli Zaretskii
2016-01-29 14:57         ` Michael Heerdegen
2016-01-29 15:33           ` Eli Zaretskii
2016-01-21 21:11 ` Keith David Bershatsky
2016-01-29  2:14   ` John Wiegley
2016-01-29  3:08 ` Keith David Bershatsky
2016-01-29  8:42   ` Eli Zaretskii
2016-01-29 15:54 ` Keith David Bershatsky
2016-02-01  3:50 ` Keith David Bershatsky
2016-02-01 19:54   ` Eli Zaretskii
2016-02-01 13:18 ` Keith David Bershatsky
2016-02-02 16:34   ` Eli Zaretskii
2016-02-02  5:58 ` Keith David Bershatsky
2016-02-02 18:16 ` Keith David Bershatsky [this message]
2016-02-02 18:43   ` Eli Zaretskii
2016-02-02 20:00 ` Keith David Bershatsky
2016-02-02 21:05 ` Keith David Bershatsky
2016-02-08  8:51 ` Keith David Bershatsky
2016-02-08 17:17   ` Eli Zaretskii
2016-02-09 16:00 ` Keith David Bershatsky
2016-02-09 17:48   ` Eli Zaretskii
2016-02-12  0:14 ` Keith David Bershatsky
2016-02-12  8:18   ` Eli Zaretskii
2016-02-16  3:39     ` Keith David Bershatsky
2016-02-12  8:25   ` Why do idle timers trigger redisplay? Eli Zaretskii
2016-02-22  6:05 ` bug#22404: 25.1.50; Forcing `window-scroll-functions` to run Keith David Bershatsky
2016-03-11 16:21 ` Keith David Bershatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2twlr9dvs.wl%esq@lawlist.com \
    --to=esq@lawlist.com \
    --cc=22404@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.