From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 03 11:14:40 2021 Received: (at submit) by debbugs.gnu.org; 3 Jan 2021 16:14:40 +0000 Received: from localhost ([127.0.0.1]:38445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kw61g-0005gZ-Bi for submit@debbugs.gnu.org; Sun, 03 Jan 2021 11:14:40 -0500 Received: from lists.gnu.org ([209.51.188.17]:40066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kw61e-0005gR-6L for submit@debbugs.gnu.org; Sun, 03 Jan 2021 11:14:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kw61e-00034K-0T for bug-gnu-emacs@gnu.org; Sun, 03 Jan 2021 11:14:38 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44240) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kw61d-0007gc-Pd for bug-gnu-emacs@gnu.org; Sun, 03 Jan 2021 11:14:37 -0500 Received: from [2607:fea8:3fdf:f688:79d0:a704:3aee:7a59] (port=44282 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kw61d-0004IE-5i for bug-gnu-emacs@gnu.org; Sun, 03 Jan 2021 11:14:37 -0500 From: Amin Bandali To: bug-gnu-emacs@gnu.org Subject: 28.0.50; Scrolling on echo area with pixel-scroll-mode enabled locks up Emacs Date: Sun, 03 Jan 2021 11:14:35 -0500 Message-ID: <87zh1qc80k.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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. I can reproduce in emacs -Q after evaluating the following in *scratch*: (require 'pixel-scroll) (pixel-scroll-mode 1) In GNU Emacs 28.0.50 (build 17, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.10, Xaw3d scroll bars) of 2021-01-03 built on trisquel Repository revision: 825b4ec338e82869dc656c7041ab2483b6c22479 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Trisquel GNU/Linux Etiona (9.0) Configured using: 'configure --without-gconf --without-gsettings --without-gpm --with-x-toolkit=lucid --with-xaw3d --with-mailutils' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 Important settings: value of $LANG: en_CA.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: yas-global-mode: t yas-minor-mode: t global-hl-todo-mode: t hl-todo-mode: t global-page-break-lines-mode: t page-break-lines-mode: t recentf-mode: t display-battery-mode: t display-time-mode: t save-place-mode: t savehist-mode: t show-paren-mode: t icomplete-mode: t fido-mode: t server-mode: t winner-mode: t global-auto-revert-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t global-prettify-symbols-mode: t prettify-symbols-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t temp-buffer-resize-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow orgalist org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete pcomplete comint org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys org-compat org-macs org-loaddefs flyspell ispell emacsbug vc-git diff-mode sort smiley ansi-color gnus-cite mail-extr gnus-async gnus-bcklg gnus-draft gnus-ml gnus-topic nndraft nnmh gnutls utf-7 epa-file network-stream nsm nnfolder nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache ebdb-gnus gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum shr kinsoku svg dom gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int gnus-range gnus-win ebdb-message sendmail message rmc puny dired-x dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 gmm-utils mailheader ebdb-mua ebdb-com crm ebdb-format ebdb mailabbrev eieio-opt speedbar ezimage dframe find-func eieio-base cal-menu calendar cal-loaddefs timezone gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums text-property-search time-date mail-utils mm-util mail-prsvr boxquote rect yasnippet hl-todo pcase disp-table page-break-lines easy-mmode delight recentf tree-widget wid-edit format-spec battery dbus time xml finder-inf info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source password-cache json subr-x map url-vars cl-extra help-mode saveplace savehist paren bandali-erc bandali-ebdb bandali-message bandali-gnus bandali-dired bandali-ibuffer ibuf-macs bandali-eshell icomplete bandali-org bandali-exwm exwm-edit exwm-systemtray xcb-systemtray xcb-xembed exwm-randr xcb-randr exwm-config ido seq exwm exwm-input xcb-keysyms xcb-xkb exwm-manage exwm-floating xcb-cursor xcb-render exwm-layout exwm-workspace exwm-core easymenu xcb-ewmh xcb-icccm xcb xcb-xproto xcb-types cl-seq xcb-debug eieio byte-opt bytecomp byte-compile cconv eieio-core eieio-loaddefs server edmacro kmacro advice winner ring autorevert filenotify cl-macs gv cl-loaddefs cl-lib iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting font-render-setting cairo x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 332287 11838) (symbols 48 35073 4) (strings 32 103624 4194) (string-bytes 1 3551705) (vectors 16 68136) (vector-slots 8 1025323 12351) (floats 8 392 338) (intervals 56 825 0) (buffers 984 11)) From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 03 12:30:58 2021 Received: (at 45628) by debbugs.gnu.org; 3 Jan 2021 17:30:58 +0000 Received: from localhost ([127.0.0.1]:38539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kw7DW-0007cM-3b for submit@debbugs.gnu.org; Sun, 03 Jan 2021 12:30:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kw7DU-0007c9-GM for 45628@debbugs.gnu.org; Sun, 03 Jan 2021 12:30:56 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45680) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kw7DL-0003Cg-6L; Sun, 03 Jan 2021 12:30:47 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3162 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kw7DJ-0002Sl-Cj; Sun, 03 Jan 2021 12:30:46 -0500 Date: Sun, 03 Jan 2021 19:30:33 +0200 Message-Id: <83ble6c4hy.fsf@gnu.org> From: Eli Zaretskii To: Amin Bandali , Tak Kunihiro In-Reply-To: <87zh1qc80k.fsf@gnu.org> (message from Amin Bandali on Sun, 03 Jan 2021 11:14:35 -0500) Subject: Re: bug#45628: 28.0.50; Scrolling on echo area with pixel-scroll-mode enabled locks up Emacs References: <87zh1qc80k.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45628 Cc: 45628@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Amin Bandali > Date: Sun, 03 Jan 2021 11:14:35 -0500 > > 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. > > I can reproduce in emacs -Q after evaluating the following in *scratch*: > > (require 'pixel-scroll) > (pixel-scroll-mode 1) Thanks. 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 04 03:58:05 2021 Received: (at 45628) by debbugs.gnu.org; 4 Jan 2021 08:58:05 +0000 Received: from localhost ([127.0.0.1]:52462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwLgd-0008C8-PM for submit@debbugs.gnu.org; Mon, 04 Jan 2021 03:58:05 -0500 Received: from mlsec.cc.okayama-u.ac.jp ([150.46.12.254]:60309) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwLga-0008Be-F4 for 45628@debbugs.gnu.org; Mon, 04 Jan 2021 03:57:58 -0500 Received: from jlsv301.okayama-u.ac.jp (unknown [150.46.12.5]) by mlsec.cc.okayama-u.ac.jp with smtp id 7277_88a2_fe74eda0_ffef_449f_bfe0_9f2f953a02e1; Mon, 04 Jan 2021 17:57:48 +0900 Received: from [192.168.1.53] (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by jlsv301.okayama-u.ac.jp (Postfix) with ESMTPSA id 9DE1776022D; Mon, 4 Jan 2021 17:57:48 +0900 (JST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: bug#45628: 28.0.50; Scrolling on echo area with pixel-scroll-mode enabled locks up Emacs From: Tak Kunihiro In-Reply-To: <83ble6c4hy.fsf@gnu.org> Date: Mon, 4 Jan 2021 17:57:48 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: <245408FF-2A90-4AA2-9301-4E2C7C1C9980@misasa.okayama-u.ac.jp> References: <87zh1qc80k.fsf@gnu.org> <83ble6c4hy.fsf@gnu.org> To: 45628@debbugs.gnu.org, Eli Zaretskii , Amin Bandali X-Mailer: Apple Mail (2.3608.120.23.2.4) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 5 Rules triggered GME_TWTRE=0.1, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV6906=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6906> : inlines <7226> : streams <1878101> : uri <3183742> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 45628 Cc: =?utf-8?B?5Zu95bqD5Y2T5Lmf?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> 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. >=20 > Tak, can you please look into this? The code infloops inside > pixel-scroll-down, here: >=20 > (while (pixel-point-at-bottom-p amt) ; prevent too late (multi = tries) > (vertical-motion -1)) ; move point upward >=20 > because the mini-window is normally just one screen line high, so its > top and bottom coincide. >=20 > Shouldn't we exit the loop when vertical-motion returns zero, which > means it didn't move? >=20 > A similar loop exists in pixel-scroll-up, AFAICS. Thank you to shoot the problem.=20 I confirmed the problem and Eli's suggestion solves it. I think that following patch would work but usage of `while=E2=80=99 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 =20 (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 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 04 10:16:57 2021 Received: (at 45628) by debbugs.gnu.org; 4 Jan 2021 15:16:57 +0000 Received: from localhost ([127.0.0.1]:59978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwRbN-0000kK-EI for submit@debbugs.gnu.org; Mon, 04 Jan 2021 10:16:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwRbL-0000k6-Hy for 45628@debbugs.gnu.org; Mon, 04 Jan 2021 10:16:55 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36391) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwRbC-0007Ky-LA; Mon, 04 Jan 2021 10:16:46 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3311 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kwRbA-0005rC-NR; Mon, 04 Jan 2021 10:16:45 -0500 Date: Mon, 04 Jan 2021 17:16:35 +0200 Message-Id: <83turwbulo.fsf@gnu.org> From: Eli Zaretskii To: Tak Kunihiro In-Reply-To: <245408FF-2A90-4AA2-9301-4E2C7C1C9980@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Mon, 4 Jan 2021 17:57:48 +0900) Subject: Re: bug#45628: 28.0.50; Scrolling on echo area with pixel-scroll-mode enabled locks up Emacs References: <87zh1qc80k.fsf@gnu.org> <83ble6c4hy.fsf@gnu.org> <245408FF-2A90-4AA2-9301-4E2C7C1C9980@misasa.okayama-u.ac.jp> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45628 Cc: 45628@debbugs.gnu.org, bandali@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Tak Kunihiro > Date: Mon, 4 Jan 2021 17:57:48 +0900 > Cc: 国広卓也 > > I think that following patch would work but usage of `while’ > does not look cool. If there can is better style, please > suggest me. How about a normal while loop with catch before it and throw inside? > - (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 I think equality to 1 or -1 is too stringent. vertical-motion could move more if you have overlay strings or display strings at point that include embedded newlines. So I think you should test >= 1 and <= -1 respectively. Also, I believe this problem exists on the emacs-27 branch as well, right? Then we should install there first. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 05 19:47:35 2021 Received: (at 45628) by debbugs.gnu.org; 6 Jan 2021 00:47:35 +0000 Received: from localhost ([127.0.0.1]:43040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwwz8-0004Bj-OF for submit@debbugs.gnu.org; Tue, 05 Jan 2021 19:47:34 -0500 Received: from mlsec.cc.okayama-u.ac.jp ([150.46.12.254]:39022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwwz6-0004BY-6r for 45628@debbugs.gnu.org; Tue, 05 Jan 2021 19:47:33 -0500 Received: from jlsv301.okayama-u.ac.jp (unknown [150.46.12.5]) by mlsec.cc.okayama-u.ac.jp with smtp id 6f31_47e8_90c734e3_9952_46d4_bfb9_543b50efea98; Wed, 06 Jan 2021 09:47:26 +0900 Received: from [192.168.1.53] (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by jlsv301.okayama-u.ac.jp (Postfix) with ESMTPSA id 5C9D076049E; Wed, 6 Jan 2021 09:47:26 +0900 (JST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: bug#45628: 28.0.50; Scrolling on echo area with pixel-scroll-mode enabled locks up Emacs From: Tak Kunihiro In-Reply-To: <83turwbulo.fsf@gnu.org> Date: Wed, 6 Jan 2021 09:47:26 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: References: <87zh1qc80k.fsf@gnu.org> <83ble6c4hy.fsf@gnu.org> <245408FF-2A90-4AA2-9301-4E2C7C1C9980@misasa.okayama-u.ac.jp> <83turwbulo.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3608.120.23.2.4) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 5 Rules triggered GME_TWTRE=0.1, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV6907=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6907> : inlines <7226> : streams <1878259> : uri <3184658> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 45628 Cc: 45628@debbugs.gnu.org, =?utf-8?B?5Zu95bqD5Y2T5Lmf?= , Amin Bandali X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > How about a normal while loop with catch before it and throw inside? >=20 > + (while (and (pixel-point-at-top-p amt) ; prevent too late = (multi tries) > + (equal (vertical-motion 1) 1))) ; move point = downward >=20 > + (while (and (pixel-point-at-bottom-p amt) ; prevent too late = (multi tries) > + (equal (vertical-motion -1) -1))) ; move point = upward >=20 > I think equality to 1 or -1 is too stringent. vertical-motion could > move more if you have overlay strings or display strings at point that > include embedded newlines. So I think you should test >=3D 1 and <=3D = -1 > respectively. I revised the patch and is attached on this message. > Also, I believe this problem exists on the emacs-27 branch as well, > right? Then we should install there first. Yes. Can you install the patch with the commit message to emacs-27 = branch? TIA commit message Avoid infloop on scrolling a window with one screen line height. =20 * lisp/pixel-scroll.el (pixel-scroll-up, pixel-scroll-down): Escape while loop when point did not move by `vertical-motion'. = (Bug#45628) diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index cc0e159fae..68dc0fb94b 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -132,8 +132,10 @@ 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 + (catch 'no-movement + (while (pixel-point-at-top-p amt) ; prevent too late (multi = tries) + (unless (>=3D (vertical-motion 1) 1) ; move point = downward + (throw 'no-movement nil)))) ; exit loop when point did = not move (pixel-scroll-pixel-up amt)))))) ; move scope downward =20 (defun pixel-scroll-down (&optional arg) @@ -149,8 +151,10 @@ 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 + (catch 'no-movement + (while (pixel-point-at-bottom-p amt) ; prevent too late = (multi tries) + (unless (<=3D (vertical-motion -1) -1) ; move point upward + (throw 'no-movement nil)))) ; exit loop when point did = not move (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 From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 09 04:22:44 2021 Received: (at 45628-done) by debbugs.gnu.org; 9 Jan 2021 09:22:44 +0000 Received: from localhost ([127.0.0.1]:51214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyASK-0005OL-5u for submit@debbugs.gnu.org; Sat, 09 Jan 2021 04:22:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyASI-0005O4-Lh for 45628-done@debbugs.gnu.org; Sat, 09 Jan 2021 04:22:42 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57407) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyAS9-0003M3-G0; Sat, 09 Jan 2021 04:22:33 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4230 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kyAS8-0006FD-D6; Sat, 09 Jan 2021 04:22:32 -0500 Date: Sat, 09 Jan 2021 11:22:35 +0200 Message-Id: <834kjqihwk.fsf@gnu.org> From: Eli Zaretskii To: Tak Kunihiro In-Reply-To: (message from Tak Kunihiro on Wed, 6 Jan 2021 09:47:26 +0900) Subject: Re: bug#45628: 28.0.50; Scrolling on echo area with pixel-scroll-mode enabled locks up Emacs References: <87zh1qc80k.fsf@gnu.org> <83ble6c4hy.fsf@gnu.org> <245408FF-2A90-4AA2-9301-4E2C7C1C9980@misasa.okayama-u.ac.jp> <83turwbulo.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 45628-done Cc: 45628-done@debbugs.gnu.org, bandali@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Tak Kunihiro > Date: Wed, 6 Jan 2021 09:47:26 +0900 > Cc: 国広卓也 , > Amin Bandali , > 45628@debbugs.gnu.org > > > How about a normal while loop with catch before it and throw inside? > > > > + (while (and (pixel-point-at-top-p amt) ; prevent too late (multi tries) > > + (equal (vertical-motion 1) 1))) ; move point downward > > > > + (while (and (pixel-point-at-bottom-p amt) ; prevent too late (multi tries) > > + (equal (vertical-motion -1) -1))) ; move point upward > > > > I think equality to 1 or -1 is too stringent. vertical-motion could > > move more if you have overlay strings or display strings at point that > > include embedded newlines. So I think you should test >= 1 and <= -1 > > respectively. > > I revised the patch and is attached on this message. > > > > Also, I believe this problem exists on the emacs-27 branch as well, > > right? Then we should install there first. > > Yes. Can you install the patch with the commit message to emacs-27 branch? Thanks, I installed this on the emacs-27 branch, and I'm closing this bug report. From unknown Tue Jun 17 01:48:00 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 06 Feb 2021 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator