From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tak Kunihiro Newsgroups: gmane.emacs.bugs Subject: bug#29374: patch for lisp/pixel-scroll Date: Tue, 21 Nov 2017 13:35:07 +0900 (JST) Message-ID: <20171121.133507.1594356869079427384.tkk@misasa.okayama-u.ac.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1511238980 15342 195.159.176.226 (21 Nov 2017 04:36:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 21 Nov 2017 04:36:20 +0000 (UTC) Cc: tkk@misasa.okayama-u.ac.jp To: 29374@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 21 05:36:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1eH0I6-00036o-5Q for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Nov 2017 05:36:10 +0100 Original-Received: from localhost ([::1]:60882 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eH0IA-0006Q3-AJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Nov 2017 23:36:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eH0I2-0006Pm-0p for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 23:36:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eH0Hy-0006E7-SB for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 23:36:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41076) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eH0Hy-0006Dr-P1 for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 23:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eH0Hy-0000Et-GJ for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 23:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Nov 2017 04:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1511238932879 (code B ref -1); Tue, 21 Nov 2017 04:36:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Nov 2017 04:35:32 +0000 Original-Received: from localhost ([127.0.0.1]:49757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eH0HT-0000E7-QT for submit@debbugs.gnu.org; Mon, 20 Nov 2017 23:35:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39085) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eH0HR-0000Du-Lg for submit@debbugs.gnu.org; Mon, 20 Nov 2017 23:35:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eH0HL-0005ql-EC for submit@debbugs.gnu.org; Mon, 20 Nov 2017 23:35:24 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:55186) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eH0HL-0005qZ-9c for submit@debbugs.gnu.org; Mon, 20 Nov 2017 23:35:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eH0HK-0006NW-25 for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 23:35:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eH0HG-0005nM-SZ for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 23:35:22 -0500 Original-Received: from mxl065v65.mxlogic.net ([208.81.65.65]:40118 helo=s14p02o142.mxlogic.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eH0HG-0005lA-DP for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 23:35:18 -0500 Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o142.mxlogic.net(mxl_mta-8.5.0-1920) over TLS secured channel with ESMTP id 00da31a5.0.319739.00-393.662561.s14p02o142.mxlogic.net (envelope-from ); Mon, 20 Nov 2017 21:35:12 -0700 (MST) X-MXL-Hash: 5a13ad0016c5ec08-026afd66ca644b96ec7100ccdd03594d898a4267 Original-Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 2f11_7833_cc761e6e_3ac4_4f48_b49e_9ba1eadd1f64; Tue, 21 Nov 2017 13:35:08 +0900 Original-Received: from localhost (unknown [172.24.1.79]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id 9E44E4C0B01; Tue, 21 Nov 2017 13:35:08 +0900 (JST) X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 4 Rules triggered EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV6162=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6162> : inlines <6176> : streams <1770898> : uri <2537621> X-AnalysisOut: [v=2.2 cv=IMhyMknG c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=kj9zAlcOel0A:10 a=sC3] X-AnalysisOut: [jslCIGhcA:10 a=gxZ1MVgiCXhbhwS93WQA:9 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5100000000; CM=0.500; MH=0.510(2017112018); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140187 Archived-At: I'm sending a patch for lisp/pixel-scroll.el. This patch fixes movement of cursor to stay away from the top of the line and the end of the line on a screen. ChangeLog entry and a patch are attached. * ChangeLog 2017-11-21 Tak Kunihiro Fix cursor movement to stay away from the top of line and the end of line on a screen * lisp/pixel-scroll.el (pixel-scroll-up): Move cursor down regardless eob is shown on the top. (pixel-scroll-down) Move cursor up regardless bob is shown on the top. * Patch diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el old mode 100644 new mode 100755 index 2213a02..556613d --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -110,11 +110,11 @@ This is an alternative of `scroll-up'. Scope moves downward." pixel-resolution-fine-flag (frame-char-height)) (pixel-line-height)))) - (if (pixel-eob-at-top-p) ; when end-of-the-buffer is close - (scroll-up 1) ; relay on robust method - (while (pixel-point-at-top-p amt) ; prevent too late (multi tries) - (vertical-motion 1)) ; move point downward - (pixel-scroll-pixel-up amt))))) ; move scope downward + (while (pixel-point-at-top-p amt) ; prevent too late (multi tries) + (vertical-motion 1)) ; move point downward + (if (pixel-eob-at-top-p) ; when end-of-the-buffer is close + (scroll-up 1) ; relay on robust method + (pixel-scroll-pixel-up amt))))) ; move scope downward (defun pixel-scroll-down (&optional arg) "Scroll text of selected window down ARG lines. @@ -127,11 +127,11 @@ This is and alternative of `scroll-down'. Scope moves upward." pixel-resolution-fine-flag (frame-char-height)) (pixel-line-height -1)))) - (if (or (pixel-bob-at-top-p amt) ; when beginning-of-the-buffer is seen - (pixel-eob-at-top-p)) ; for file with a long line - (scroll-down 1) ; relay on robust method - (while (pixel-point-at-bottom-p amt) ; prevent too late (multi tries) - (vertical-motion -1)) + (while (pixel-point-at-bottom-p amt) ; prevent too late (multi tries) + (vertical-motion -1)) ; move point upward + (if (or (pixel-bob-at-top-p amt) ; when beginning-of-the-buffer is seen + (pixel-eob-at-top-p)) ; for file with a long line + (scroll-down 1) ; relay on robust method (pixel-scroll-pixel-down amt))))) (defun pixel-bob-at-top-p (amt)