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: Tue, 27 Oct 2020 20:32:50 +0200 Message-ID: <83ft5zecz1.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> <183EE2A7-4FF5-4888-A6F5-BDE08BD5F482@gmail.com> <83imb2kzu0.fsf@gnu.org> <83eelqkx1k.fsf@gnu.org> <83a6wdlbns.fsf@gnu.org> <83r1poizhx.fsf@gnu.org> <9F2380D3-D1CC-410E-A91D-531AA0DFE1DB@gmail.com> <838sbwhz3k.fsf@gnu.org> 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="26096"; 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 Tue Oct 27 19:53:10 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 1kXU5l-0006hO-GI for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 27 Oct 2020 19:53:09 +0100 Original-Received: from localhost ([::1]:49184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXU5k-0006SF-EG for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 27 Oct 2020 14:53:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXTmC-0000zL-JM for help-gnu-emacs@gnu.org; Tue, 27 Oct 2020 14:32:56 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55852) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXTmC-0004Zn-9x for help-gnu-emacs@gnu.org; Tue, 27 Oct 2020 14:32:56 -0400 Original-Received: from [176.228.60.248] (port=2648 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kXTmB-0000SO-Gz for help-gnu-emacs@gnu.org; Tue, 27 Oct 2020 14:32:55 -0400 In-Reply-To: (message from Yuan Fu on Tue, 27 Oct 2020 14:10:58 -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:124743 Archived-At: > From: Yuan Fu > Date: Tue, 27 Oct 2020 14:10:58 -0400 > Cc: help-gnu-emacs > > This is not about other editors, really. The main motivation is that with the current behavior, if I have images and text in the same buffer and I scroll down/up, the display jumps up and down and I get lost: I kind of lost track of where I am in the buffer. The desired behavior is, of course, a stable, smooth, unsurprised scrolling. And you can have that, just don't use any functions that set the window's start point. E.g., scroll by setting vscroll, and when that is about to scroll past the last portion of the image, move point to the next/previous line and set vscroll to a suitable value. More or less like image-mode.el does. Scroll commands via scroll-up/down are for different use cases, so they don't do what you want. > How should I move the discussion to emacs-devel? Should I post a new thread and explain the disagreement/confusion? Start new thread, yes. What to discuss there is up to you. I still have no clear idea what are you looking for. AFAIU, the problem you are trying to solve doesn't need any change in how window-start and vscroll are handled, so I don't understand why you insist on changing that. > I think it does make sense for window-start and vscroll to work together, and the implementation of redisplay seems to suggest that. Could you explain how is inserting sit-for makes sense but setting both flags at the same time doesn’t? You don't need sit-for if you just set vscroll, I think. The need for sit-for in your original code was because you set window-start, something you shouldn't do to solve your problem.