From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: scroll-down with pixel transition Date: Tue, 11 Apr 2017 10:44:08 +0300 Message-ID: <8360ibl77b.fsf@gnu.org> References: <83mvbols77.fsf@gnu.org> <51DD8835-1124-41A4-85E1-9B7B8DC9E1D4@misasa.okayama-u.ac.jp> <83efx0lnd2.fsf@gnu.org> <20170411.072417.159896512.tkk@misasa.okayama-u.ac.jp> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1491896675 24772 195.159.176.226 (11 Apr 2017 07:44:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Apr 2017 07:44:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tak Kunihiro Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 11 09:44:28 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxqTU-0006KJ-KF for ged-emacs-devel@m.gmane.org; Tue, 11 Apr 2017 09:44:28 +0200 Original-Received: from localhost ([::1]:37626 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxqTa-0000Cy-Hq for ged-emacs-devel@m.gmane.org; Tue, 11 Apr 2017 03:44:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxqT0-0000Cn-Fy for emacs-devel@gnu.org; Tue, 11 Apr 2017 03:43:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxqSv-0004L7-U8 for emacs-devel@gnu.org; Tue, 11 Apr 2017 03:43:58 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxqSv-0004Ku-Qz; Tue, 11 Apr 2017 03:43:53 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4467 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cxqSt-00053C-Qu; Tue, 11 Apr 2017 03:43:52 -0400 In-reply-to: <20170411.072417.159896512.tkk@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Tue, 11 Apr 2017 07:24:17 +0900 (JST)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:213845 Archived-At: > Date: Tue, 11 Apr 2017 07:24:17 +0900 (JST) > Cc: emacs-devel@gnu.org, tkk@misasa.okayama-u.ac.jp > From: Tak Kunihiro > > >> It works. > >> Is there a way to visually hide the overshoot on (scroll-down 1)? > > > > I don't understand the question. The display is only refreshed when > > you call sit-for, so you have complete control of that already, and > > AFAICS the code does what you told it to do. Am I missing something? > > In Emacs around me (25.1 on Mac, 25.1 on Windows), the following lines > give me overshoot for each scroll-down. Is not the case for you? > > (dotimes (ii 10) > (scroll-down 1) > (set-window-vscroll nil (1- (frame-char-height)) t) (sit-for 0.05) > (dolist (vs (reverse (number-sequence 0 (- (frame-char-height) 2)))) > (set-window-vscroll nil vs t) (sit-for 0.05))) I'm still not sure what you mean by "overshoot", but if that's the extra full-line scroll for each of the 10 iterations, then you see the same in the snippet you shown that scrolls in the other direction, if you look carefully. The current display code doesn't like starting a window with a partially visible line, so it zeroes out the vscroll if that produces a fully-visible line at the window start. E.g., try this: (progn (vertical-motion 1) (dolist (vs (number-sequence 1 (- (frame-char-height) 6))) (set-window-vscroll nil vs t) (sit-for 0.001))) This ends up with the first window line partially visible, but as soon as you move the cursor (triggering a redisplay cycle, just like sit-for does), Emacs zeroes the window's vscroll to make that line fully visible. Changing that (probably as some special optional mode) will require changes in the display engine on the C level and in probably also in the line-moving commands in simple.el. Patches welcome.