From: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
To: 45628@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
Amin Bandali <bandali@gnu.org>
Cc: 国広卓也 <tkk@misasa.okayama-u.ac.jp>
Subject: bug#45628: 28.0.50; Scrolling on echo area with pixel-scroll-mode enabled locks up Emacs
Date: Mon, 4 Jan 2021 17:57:48 +0900 [thread overview]
Message-ID: <245408FF-2A90-4AA2-9301-4E2C7C1C9980@misasa.okayama-u.ac.jp> (raw)
In-Reply-To: <83ble6c4hy.fsf@gnu.org>
>> As the Subject says, scrolling using the mouse wheel on the echo area
>> causes Emacs to freeze/lock up (cursor is changed to spinning circle),
>> when pixel-scroll-mode is enabled.
>
> Tak, can you please look into this? The code infloops inside
> pixel-scroll-down, here:
>
> (while (pixel-point-at-bottom-p amt) ; prevent too late (multi tries)
> (vertical-motion -1)) ; move point upward
>
> because the mini-window is normally just one screen line high, so its
> top and bottom coincide.
>
> Shouldn't we exit the loop when vertical-motion returns zero, which
> means it didn't move?
>
> A similar loop exists in pixel-scroll-up, AFAICS.
Thank you to shoot the problem.
I confirmed the problem and Eli's suggestion solves it.
I think that following patch would work but usage of `while’
does not look cool. If there can is better style, please
suggest me.
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index cc0e159fae..c266c54a06 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -132,8 +132,8 @@ pixel-scroll-up
(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
+ (while (and (pixel-point-at-top-p amt) ; prevent too late (multi tries)
+ (equal (vertical-motion 1) 1))) ; move point downward
(pixel-scroll-pixel-up amt)))))) ; move scope downward
(defun pixel-scroll-down (&optional arg)
@@ -149,8 +149,8 @@ pixel-scroll-down
pixel-resolution-fine-flag
(frame-char-height))
(pixel-line-height -1))))
- (while (pixel-point-at-bottom-p amt) ; prevent too late (multi tries)
- (vertical-motion -1)) ; move point upward
+ (while (and (pixel-point-at-bottom-p amt) ; prevent too late (multi tries)
+ (equal (vertical-motion -1) -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
next prev parent reply other threads:[~2021-01-04 8:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-03 16:14 bug#45628: 28.0.50; Scrolling on echo area with pixel-scroll-mode enabled locks up Emacs Amin Bandali
2021-01-03 17:30 ` Eli Zaretskii
2021-01-04 8:57 ` Tak Kunihiro [this message]
2021-01-04 15:16 ` Eli Zaretskii
2021-01-06 0:47 ` Tak Kunihiro
2021-01-09 9:22 ` 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=245408FF-2A90-4AA2-9301-4E2C7C1C9980@misasa.okayama-u.ac.jp \
--to=tkk@misasa.okayama-u.ac.jp \
--cc=45628@debbugs.gnu.org \
--cc=bandali@gnu.org \
--cc=eliz@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.