unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: 32839@debbugs.gnu.org
Subject: bug#32839: 27.0.50; recenter doesn't redisplay
Date: Fri, 28 Sep 2018 09:22:07 +0300	[thread overview]
Message-ID: <83k1n66t0w.fsf@gnu.org> (raw)
In-Reply-To: <875zyqwnrb.fsf@mail.linkov.net> (message from Juri Linkov on Fri, 28 Sep 2018 01:59:04 +0300)

> From: Juri Linkov <juri@linkov.net>
> Cc: 32839@debbugs.gnu.org
> Date: Fri, 28 Sep 2018 01:59:04 +0300
> 
> >>      (recenter 0 t)
> >>
> >>    Despite its REDISPLAY argument set to t, the frame is not redisplayed.
> >
> > This is how 'recenter' is documented to behave:
> >
> >   If ARG is omitted or nil, then recenter with point on the middle line
> >   of the selected window; if REDISPLAY & ‘recenter-redisplay’ are
> >   non-nil, also erase the entire frame and redraw it [...]
> >
> > IOW, the frame is redrawn only when ARG is nil and REDISPLAY is
> > non-nil.
> 
> Then why REDISPLAY is non-nil, if it doesn't redisplay the frame?

There's a long history to this, you may wish to use "git -L" and look
at the discussions/bug reports related to 'recenter'.

The short answer is that this arrangement (which is new in Emacs 27)
has its main goal to allow "C-l" to redraw the entire frame when the
user so desires (by default, only on TTY frames), while avoiding the
frame redraw in most, if not all, other situations, because redrawing
a frame causes flickering.  This flickering is caused by Lisp programs
calling 'recenter', directly or indirectly.

> I thought that scrolling for the sake of window-scroll-functions
> implies the changes in the value of window-start, i.e. when
> an old value of window-start is not the same as its new value,
> this guarantees the call of window-scroll-functions.

That'd cause window-scroll-functions to be called in too many
unrelated situations, because almost every redisplay cycle changes the
value of window-start.  E.g., consider goto-char or goto-line or even
C-s that finds the match off-screen.

> The docstring of window-scroll-functions says:
> 
>   These functions are called whenever the ‘window-start’ marker is modified,
>   either to point into another buffer (e.g. via ‘set-window-buffer’) or another
>   place in the same buffer.

You've omitted the first line of the doc string:

  List of functions to call before redisplaying a window with scrolling.
                                                         ^^^^^^^^^^^^^^
> Maybe it will be called in the new hook window-state-change-functions
> proposed by Martin.

I hope not.





  reply	other threads:[~2018-09-28  6:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 19:11 bug#32839: 27.0.50; recenter doesn't redisplay Juri Linkov
2018-09-25 20:08 ` Eli Zaretskii
2018-09-25 20:55   ` Juri Linkov
2018-09-26  5:39     ` Eli Zaretskii
2018-09-26 23:55       ` Juri Linkov
2018-09-27  6:44         ` Eli Zaretskii
2018-09-27 22:59           ` Juri Linkov
2018-09-28  6:22             ` Eli Zaretskii [this message]
2018-09-29 23:32               ` Juri Linkov
2018-09-30  6:08                 ` Eli Zaretskii
2018-09-30 19:40                   ` Juri Linkov
2018-10-01  5:34                     ` Eli Zaretskii
2018-09-29 23:38               ` Juri Linkov
2018-09-30  6:22                 ` Eli Zaretskii
2018-09-30 19:46                   ` Juri Linkov
2018-10-01  6:58                     ` Eli Zaretskii
2018-10-08 22:56                   ` Juri Linkov
2018-10-09  7:44                     ` martin rudalics
2020-02-07  0:30           ` Juri Linkov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83k1n66t0w.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=32839@debbugs.gnu.org \
    --cc=juri@linkov.net \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).