From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Set-window-vscroll sometimes doesn't work Date: Thu, 22 Oct 2020 19:05:01 +0300 Message-ID: <83k0vil00i.fsf@gnu.org> References: <72B62847-3F35-412A-9F74-88442A936B19@gmail.com> <83eelvsivm.fsf@gnu.org> <853C8CD1-B58B-4F22-A889-4AB2AEE3DD80@gmail.com> <83imb7qw46.fsf@gnu.org> <66013ADF-731C-4922-8AF7-EAFDBF43C33C@gmail.com> <83ft6bqv0q.fsf@gnu.org> <4F2C1811-940E-4C58-8EE0-37AA3B666E12@gmail.com> <835z77qr3f.fsf@gnu.org> <834kmrq7gy.fsf@gnu.org> <83blgyp4k2.fsf@gnu.org> <4F794407-585E-4C74-85F3-00A668FB9675@gmail.com> <834kmqp1ts.fsf@gnu.org> <835z74ope5.fsf@gnu.org> <1B858755-4CAE-4E06-B867-098B323EF79E@gmail.com> <83h7qnmtq4.fsf@gnu.org> <8C545387-7A95-4B4E-A71E-05949E8A4641@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="572"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 22 18:06:17 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kVd6W-000AaA-Rc for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 22 Oct 2020 18:06:16 +0200 Original-Received: from localhost ([::1]:55350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVd6V-0007OF-Sx for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 22 Oct 2020 12:06:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVd57-0006hj-R4 for help-gnu-emacs@gnu.org; Thu, 22 Oct 2020 12:04:49 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46304) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVd57-0001Ud-Ha for help-gnu-emacs@gnu.org; Thu, 22 Oct 2020 12:04:49 -0400 Original-Received: from [176.228.60.248] (port=4679 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kVd56-0002wM-B1 for help-gnu-emacs@gnu.org; Thu, 22 Oct 2020 12:04:49 -0400 In-Reply-To: <8C545387-7A95-4B4E-A71E-05949E8A4641@gmail.com> (message from Yuan Fu on Wed, 21 Oct 2020 15:05:26 -0400) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124634 Archived-At: > From: Yuan Fu > Date: Wed, 21 Oct 2020 15:05:26 -0400 > Cc: help-gnu-emacs@gnu.org > > But my point was that you shouldn't set window-start if you need to > use a non-zero vscroll. > > It does: mwheel-scroll calls scroll-down/up, which calls window_scroll_pixel_based, which sets w->start > (and it sets vscroll for tall image). If you examine the code in window_scroll_pixel_based carefully, you will see that it either sets vscroll or w->start, but never both. > next-line and friends only vscroll when scroll-conservatively=0 and ARG=1, which allows it to get > away from the problem I face (set-window-start and set-window-vscroll in the same time). I either > implements smooth scrolling to only work when ARG=1 or I need to set both value at the same > time. > > I don't understand why you say this. First, C-n works on tall images > with arguments greater than 1. And second, I still don't understand > why you need to set window-start, because vscroll should be enough for > your needs, as far as I understand. > > C-n doesn’t smooth scroll on tall images when ARG > 1: The code checks for ARG = 1, if not, it doesn’t do > line-move-partial. I also tried C-2 C-n, no smooth scrolling. What do you mean by "smooth scrolling" here? If I invoke C-2 C-n" on a large image, the image gets scrolled by the amount of pixels that is equivalent to 2 screen lines. Isn't that what you see? > I thought vscroll is a relative measure and is measured against window-start. And it kind of makes sense to > set a window start as the basis and set vscroll based on that. So I kind of assumed that window-start is > always at least partially visible and vscroll is always less than the height of the first line. Now, if I throw away > window-start and scrolls entirely by vscroll, will there be any problems? Like, does anyone relies on > window-start being visible? I felt like that’s what people uses to get the first line displayed in the window. When vscroll is so large that the window-start point is entirely not visible, you should move window-start so it becomes visible. But that shouldn't be a problem, because it means you've scrolled the entire image off-screen.