From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Set-window-vscroll sometimes doesn't work
Date: Sun, 18 Oct 2020 20:31:21 +0300 [thread overview]
Message-ID: <83imb7qw46.fsf@gnu.org> (raw)
In-Reply-To: <853C8CD1-B58B-4F22-A889-4AB2AEE3DD80@gmail.com> (message from Yuan Fu on Sun, 18 Oct 2020 13:24:25 -0400)
> From: Yuan Fu <casouri@gmail.com>
> Date: Sun, 18 Oct 2020 13:24:25 -0400
> Cc: help-gnu-emacs@gnu.org
>
> No. The problem is in your code. First, you use set-window-start and
> scroll-down, both of which tramp window-vscroll (as you probably
> realize if you think about what those do).
>
> Why is so? Is there any material that I can read about these?
These two functions force Emacs to display the buffer starting at a
particular position, so vscroll is zeroed out. Otherwise, how could
Emacs obey the forced start point?
> This works, but brings flickers: the image first shows completely then the vscroll takes effect, which is
> reasonable but not preferred.
It was just an example to explain to you what should be done. E.g.,
when you scroll a tall image with C-n there's no flickering. You just
cannot mix vscroll with other code that affects the window display,
that's all.
> I found that using (set-window-start nil (point) t) with the third argument non-nil
> gives me the desired effect. My guess is that, as the doctoring said, setting that to non-nil prevents redisplay
> to try to make point completely visible, so redisplay doesn’t modify vscroll, so my vscroll value survived. Is
> that right?
NOFORCE non-nil means Emacs doesn't have to display the window
starting at the position if there are valid reasons, so yes. But my
suggestion is not to use set-window-start when you want to vscroll,
it's unsafe. You in effect create a conflict for the display engine,
and have no control on how it will resolve that conflict.
next prev parent reply other threads:[~2020-10-18 17:31 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-18 0:35 Set-window-vscroll sometimes doesn't work Yuan Fu
2020-10-18 14:34 ` Eli Zaretskii
2020-10-18 17:24 ` Yuan Fu
2020-10-18 17:31 ` Eli Zaretskii [this message]
2020-10-18 17:51 ` Yuan Fu
2020-10-18 17:55 ` Eli Zaretskii
2020-10-18 18:02 ` Yuan Fu
2020-10-18 19:12 ` Yuan Fu
2020-10-18 19:19 ` Eli Zaretskii
2020-10-18 20:06 ` Yuan Fu
2020-10-19 2:23 ` Eli Zaretskii
[not found] ` <B1D235FE-49B8-4F0A-9C02-78B7E3244C47@gmail.com>
2020-10-19 6:00 ` Yuan Fu
2020-10-19 16:24 ` Eli Zaretskii
2020-10-19 16:56 ` Yuan Fu
2020-10-19 17:23 ` Eli Zaretskii
2020-10-19 20:39 ` Yuan Fu
2020-10-20 16:04 ` Eli Zaretskii
2020-10-20 18:00 ` Yuan Fu
2020-10-20 18:19 ` Yuan Fu
2020-10-21 16:25 ` Eli Zaretskii
2020-10-21 19:05 ` Yuan Fu
2020-10-22 4:16 ` Yuan Fu
2020-10-22 16:08 ` Eli Zaretskii
2020-10-22 16:50 ` Yuan Fu
2020-10-22 17:09 ` Eli Zaretskii
2020-10-22 19:33 ` Yuan Fu
2020-10-23 6:05 ` Eli Zaretskii
2020-10-23 16:48 ` Yuan Fu
2020-10-23 18:11 ` Eli Zaretskii
2020-10-23 20:30 ` Yuan Fu
2020-10-24 7:17 ` Eli Zaretskii
2020-10-26 8:38 ` Jens C. Jensen
2020-10-26 15:18 ` Eli Zaretskii
2020-10-27 18:10 ` Yuan Fu
2020-10-27 18:32 ` Eli Zaretskii
2020-10-22 16:05 ` Eli Zaretskii
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=83imb7qw46.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@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.
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).