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: Smooth image scrolling Date: Thu, 08 Oct 2020 11:00:37 +0300 Message-ID: <837ds187ve.fsf@gnu.org> References: <87h7r5s5sp.fsf@web.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30837"; 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 08 10:01:28 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 1kQQre-0007uK-KX for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Oct 2020 10:01:26 +0200 Original-Received: from localhost ([::1]:42576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQQrd-0008SM-LN for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Oct 2020 04:01:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQQql-0008Rx-5k for help-gnu-emacs@gnu.org; Thu, 08 Oct 2020 04:00:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60413) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQQqk-00022K-LT for help-gnu-emacs@gnu.org; Thu, 08 Oct 2020 04:00:30 -0400 Original-Received: from [176.228.60.248] (port=3522 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kQQqj-0000ia-Mi for help-gnu-emacs@gnu.org; Thu, 08 Oct 2020 04:00:30 -0400 In-Reply-To: <87h7r5s5sp.fsf@web.de> (message from Michael Heerdegen on Thu, 08 Oct 2020 06:25:10 +0200) 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:124374 Archived-At: > From: Michael Heerdegen > Date: Thu, 08 Oct 2020 06:25:10 +0200 > > Normally, the calc buffers are only a few lines tall, and one image may > be quite as large, or even larger. Everything is narrow. > > Normal mouse-whell scrolling just jumps past the image, so you have no > chance to see the second half of it. Even if I scroll in one-line > steps. > > So I experimented with scrolling by changing the window's vscroll (as > image-mode uses to do). Oh, pixel-scroll-mode doesn't behave much > nicer, so that didn't help. > > But now changing the windows vscroll comes with new problems. When > increasing the window's vscroll (say, by one) moves the cursor out of > view, Emacs (redisplay I guess) moves it back into the visible buffer > part (it doesn't change point), and what I get is actually scrolling > backwards. > > I then tried to adjust point manually, which is not that simple. But > even then - when I want to get back to standard scrolling (say I have > now scrolled past the first image), Emacs silently undoes the vscroll > setting, again scrolling backwards in effect. So I would have to handle > that effect as well, probably reimplementing more or less the whole > scrolling algorithms. > > Do I miss something, or is this really ... a bit hard to achieve? It's not easy. First thing I don't understand is whether you are trying this with the mouse or with C-n/C-p. The latter should already work reasonably well for tall images (i.e. images taller than the window), see line-move and its subroutines line-move-visual and line-move-partial. Maybe the code there will give you ideas for how to solve your problem?