Package: emacs;
Reported by: Ramon Diaz-Uriarte <rdiaz02 <at> gmail.com>
Date: Wed, 27 Mar 2024 20:26:01 UTC
Severity: normal
Found in version 29.3.50
Message #29 received at 70038 <at> debbugs.gnu.org (full text, mbox):
From: Ramon Diaz-Uriarte <r.diaz <at> uam.es> To: Rahguzar <rahguzar <at> zohomail.eu> Cc: Ramon Diaz-Uriarte <rdiaz02 <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>, 70038 <at> debbugs.gnu.org Subject: Re: bug#70038: 29.3.50; Shift up/down in buffer with images on M-x other-window with some fonts Date: Sun, 31 Mar 2024 20:43:48 +0200
For me, this setting fixes the problem when there is no dependence on fonts: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq read-minibuffer-restore-windows nil) (progn (defun pin-vscroll-down (win) (set-window-vscroll win 200 t)) (let* ((height (/ (* 2 (frame-pixel-height)) 5)) (image1 (create-image "/tmp/image1.png" nil nil :height height)) (image2 (create-image "/tmp/image2.png" nil nil :height height)) (image3 (create-image "/tmp/image3.png" nil nil :height height))) (with-current-buffer (get-buffer-create "*image-scroll-test*") (insert " \n \n \n \n \n \n") (put-image image1 1) (put-image image2 5) (put-image image3 9) ;; With larger image sizes (goto-char 3) ;; also consistently triggers the problem. (goto-char 11) (add-hook 'pre-redisplay-functions #'pin-vscroll-down nil t)) (split-window-right) (other-window 1) (switch-to-buffer "*image-scroll-test*"))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; However, it does not solve the problem when I change fonts: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq read-minibuffer-restore-windows nil) (progn (defun pin-vscroll-down (win) (set-window-vscroll win 200 t)) ;; Any of the following leads to the bug (set-frame-font "JuliaMono" nil t) ;; (set-frame-font "DM Mono" nil t) ;; (set-frame-font "Intel One Mono" nil t) (let* ((height (/ (* 2 (frame-pixel-height)) 15)) (image1 (create-image "/tmp/image1.png" nil nil :height height)) (image2 (create-image "/tmp/image2.png" nil nil :height height)) (image3 (create-image "/tmp/image3.png" nil nil :height height))) (with-current-buffer (get-buffer-create "*image-scroll-test*") (insert " \n \n \n \n \n \n") (put-image image1 1) (put-image image2 5) (put-image image3 9) ;; With larger image sizes (goto-char 3) ;; also triggers the problem. (goto-char 11) (add-hook 'pre-redisplay-functions #'pin-vscroll-down nil t)) (split-window-right) (other-window 1) (switch-to-buffer "*image-scroll-test*"))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; As mentioned initially, this issue was found when trying to solve a similar problem with pdf-tools: https://github.com/vedang/pdf-tools/pull/224#issuecomment-2014151358 Setting (setq read-minibuffer-restore-windows nil) solves the pdf-tools continuous scrolling issue when there is no change in font but not when we change font (https://github.com/vedang/pdf-tools/pull/224#issuecomment-2026142343 ) Best, R. On Thu, 28-March-2024, at 21:50:49, Rahguzar <rahguzar <at> zohomail.eu> wrote: > On further testing, > > (setq read-minibuffer-restore-windows nil) > > makes the problem go away. > > Rahguzar <rahguzar <at> zohomail.eu> writes: > >> Hi Ramon, >> >> Ramon Diaz-Uriarte <rdiaz02 <at> gmail.com> writes: >> >>> Actually, maybe I can claim those bonus points: this does not depend on fonts, though I am triggering it using the package vertico (so maybe this example is vertico's fault): >>> >>> >>> Steps: >>> >>> 1. emacs -Q >>> 2. eval this code >>> >>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >>> (package-initialize) >>> (vertico-mode 1) >>> >>> (progn >>> (defun pin-vscroll-down (win) >>> (set-window-vscroll win 200 t)) >>> (let* ((height (/ (* 2 (frame-pixel-height)) 15)) >>> (image1 (create-image "/tmp/image1.png" nil nil :height height)) >>> (image2 (create-image "/tmp/image2.png" nil nil :height height)) >>> (image3 (create-image "/tmp/image3.png" nil nil :height height))) >>> (with-current-buffer (get-buffer-create "*image-scroll-test*") >>> (insert " \n \n \n \n \n \n") >>> (put-image image1 1) >>> (put-image image2 5) >>> (put-image image3 9) >>> ;; With larger image sizes (goto-char 3) >>> ;; also consistently triggers the problem. >>> (goto-char 11) >>> (add-hook 'pre-redisplay-functions #'pin-vscroll-down nil t)) >>> (split-window-right) >>> (other-window 1) >>> (switch-to-buffer "*image-scroll-test*"))) >>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >>> >>> 3. Do `M-x` (or C-x b). No need to execute anything or switch buffers, just have the minibuffer show options. >>> >>> 4. `C-x o` a few times. You'll see the images move up and down. >>> >>> I am seeing this in Lucid and GTK builds. >> >> I can also reproduce this now! And vertico mode can be replaced with the >> builtin icomplete-vertical-mode. So, the following recipe starting with >> emacs -Q works for me: >> >> 1) Paste >> (let ((height (/ (* 2 (frame-pixel-height)) 15))) >> (icomplete-vertical-mode) >> (defun pin-vscroll-down (win) >> (set-window-vscroll win (/ height 2) t)) >> (let ((image1 (create-image "~/Downloads/image1.png" nil nil :height height)) >> (image2 (create-image "~/Downloads/image2.png" nil nil :height height)) >> (image3 (create-image "~/Downloads/image3.png" nil nil :height height))) >> (with-current-buffer (get-buffer-create "*image-scroll-test*") >> (insert " \n \n \n \n \n \n") >> (put-image image1 1) >> (put-image image2 5) >> (put-image image3 9) >> ;; With larger image sizes (goto-char 3) >> ;; also consistently triggers the problem. >> (goto-char 11) >> (add-hook 'pre-redisplay-functions #'pin-vscroll-down nil t)) >> (split-window-right) >> (other-window 1) >> (switch-to-buffer "*image-scroll-test*"))) >> >> into scratch buffer. >> >> 2) Evaluate the form above using `C-M-x`. >> >> 3) Type M-x t >> >> 4) Wait till minibuffer expands to show completions, then type `C-g` to >> quit minibuffer. >> >> 5) Typing `C-x 0` results in the window with images losing vscroll. >> >>> Best, >>> >>> R. >> >> Rahguzar -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-31 Facultad de Medicina Universidad Autónoma de Madrid Arzobispo Morcillo, 4 28029 Madrid Spain
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.