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: Thu, 13 Apr 2017 13:24:47 +0300 Message-ID: <8337dcip00.fsf@gnu.org> References: <83fuhdkd96.fsf@gnu.org> <075EF948-3442-4DF5-892B-8E90810A0840@misasa.okayama-u.ac.jp> <838tn4ixh4.fsf@gnu.org> <20170413.171234.486862621.tkk@misasa.okayama-u.ac.jp> <837f2oiuqr.fsf@gnu.org> <834lxsisqh.fsf@gnu.org> <08D082D8-345E-449A-B064-2BF5E3ABE398@misasa.okayama-u.ac.jp> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1492079102 31658 195.159.176.226 (13 Apr 2017 10:25:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 13 Apr 2017 10:25:02 +0000 (UTC) Cc: emacs-devel@gnu.org, yuri.v.khan@gmail.com To: Tak Kunihiro Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 13 12:24:57 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 1cybvs-00087B-Kl for ged-emacs-devel@m.gmane.org; Thu, 13 Apr 2017 12:24:56 +0200 Original-Received: from localhost ([::1]:48407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cybvy-0005RW-JH for ged-emacs-devel@m.gmane.org; Thu, 13 Apr 2017 06:25:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cybvS-0005RP-7Q for emacs-devel@gnu.org; Thu, 13 Apr 2017 06:24:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cybvO-0004GI-6i for emacs-devel@gnu.org; Thu, 13 Apr 2017 06:24:30 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cybvO-0004GD-3Q; Thu, 13 Apr 2017 06:24:26 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2719 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cybvN-0001ts-B2; Thu, 13 Apr 2017 06:24:25 -0400 In-reply-to: <08D082D8-345E-449A-B064-2BF5E3ABE398@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Thu, 13 Apr 2017 18:22:37 +0900) 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:213939 Archived-At: > From: Tak Kunihiro > Date: Thu, 13 Apr 2017 18:22:37 +0900 > Cc: yuri.v.khan@gmail.com, Kunihiro Tak , > emacs-devel@gnu.org > > I should have eliminated codes in regard to `pixel-resolution-fine-p’. > > My intension was, to show an example of scrolling single line up with > (setq pixel-resolution-fine-p nil). For scrolling in the other direction, the following snippet should I hope show how to avoid the unwanted extra scroll: (defun pscroll-down (arg) (interactive "p") (let ((pos (save-excursion (goto-char (window-start)) (beginning-of-visual-line 0)))) (set-window-start nil pos t) (set-window-vscroll nil arg t))) (define-key global-map [f9] 'pscroll-up) With this, you can say "C-u 6 F9" and have the window text scrolled down so that the first 6 pixels of the first screen line are not shown. Since this is just a demo, there are no protection against hitting the beginning of buffer, against point being in the last screen line, etc.; but adding that should be trivial. The important part here is that you must call set-window-start as shown, to force the display engine use that particular position as the window-start point. Otherwise, redisplay will reset the window's vscroll. HTH