From: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
To: 29374@debbugs.gnu.org
Cc: tkk@misasa.okayama-u.ac.jp
Subject: bug#29374: patch for lisp/pixel-scroll
Date: Tue, 21 Nov 2017 13:35:07 +0900 (JST) [thread overview]
Message-ID: <20171121.133507.1594356869079427384.tkk@misasa.okayama-u.ac.jp> (raw)
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 <tkk@misasa.okayama-u.ac.jp>
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)
next reply other threads:[~2017-11-21 4:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-21 4:35 Tak Kunihiro [this message]
2017-11-21 15:41 ` bug#29374: patch for lisp/pixel-scroll Eli Zaretskii
2017-11-21 23:08 ` Tak Kunihiro
2017-12-01 8:58 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171121.133507.1594356869079427384.tkk@misasa.okayama-u.ac.jp \
--to=tkk@misasa.okayama-u.ac.jp \
--cc=29374@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.