From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69972: 29.1; Unexpected behavior when scrolling images Date: Mon, 25 Mar 2024 01:34:40 -0700 Message-ID: <874jcun1y9.fsf@ushin.org> References: <87sf0gm1xn.fsf@ushin.org> <86h6gwx8wv.fsf@gnu.org> <87jzlrm7lv.fsf@ushin.org> Reply-To: Joseph Turner Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26615"; mail-complaints-to="usenet@ciao.gmane.io" To: Eli Zaretskii , 69972@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 25 09:37:31 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rofpi-0006fL-LK for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Mar 2024 09:37:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rofpY-0008Ah-VK; Mon, 25 Mar 2024 04:37:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rofpY-0008AM-7H for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2024 04:37:20 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rofpX-0004oJ-Vn for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2024 04:37:19 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rofqE-0003Un-5z for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2024 04:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Mar 2024 08:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69972 X-GNU-PR-Package: emacs Original-Received: via spool by 69972-submit@debbugs.gnu.org id=B69972.171135583013340 (code B ref 69972); Mon, 25 Mar 2024 08:38:02 +0000 Original-Received: (at 69972) by debbugs.gnu.org; 25 Mar 2024 08:37:10 +0000 Original-Received: from localhost ([127.0.0.1]:47881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rofpN-0003T5-Nr for submit@debbugs.gnu.org; Mon, 25 Mar 2024 04:37:10 -0400 Original-Received: from out-178.mta1.migadu.com ([95.215.58.178]:19756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rofpJ-0003Sa-KP for 69972@debbugs.gnu.org; Mon, 25 Mar 2024 04:37:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ushin.org; s=key1; t=1711355747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9BXv9q7WePLnZhggOhGplF4tL3m7M/4gbvCSvq5L5Cs=; b=UNrvdbX5gN4lJdotIY03PukCndEQJBXrkFLQjM9GaaJb7EMVvQ1Z00LJ0/r7r+6JBtbvaE kX2iLVPe4hlcAW+Je3YGRvkIX4UEq3TVvI6pZaYfChdIoMYgU5NadRi6xqw8GTn4KOzvTD lGJ507IMmqVvzDoKlLGXtCf6WRnwbEPNaATR4GnGdm8oFE+E87P45lM4KI2HpjUMShvuGO 1NKT34t4haRU+30VtaIWdEujQi4RkuqoNZAdllBY/3JEaBi7Ky4+NP9U55SLGkUnCPaB+q +QdZ88fll2jd+8+BOe6lHQNz3QeNRRaztj3GikFN4Tfo87XRNr7skh9yfT+Ttw== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <87jzlrm7lv.fsf@ushin.org> X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282048 Archived-At: Joseph Turner writes: > Eli Zaretskii writes: > >>> Date: Sun, 24 Mar 2024 02:07:16 -0700 >>> From: Joseph Turner via "Bug reports for GNU Emacs, >>> the Swiss army knife of text editors" >>> >>> When the image at point is larger than the current window and there is >>> no content after the image, interactively scrolling down (with the >>> scroll-up command) unexpectedly scrolls past the image to blankness. >> >> I cannot reproduce this, I think. >> >>> Test this by evaluating the following snippet then interactively running >>> `scroll-up' repeatedly: >>> >>> (with-current-buffer (get-buffer-create "*test-scroll-image*") >>> (erase-buffer) >>> (insert-image (create-image "splash.png" nil nil >>> ;; Scale the image more if it doesn't take up the whole window. >>> :scale 5)) >>> (goto-char (point-max)) >>> (pop-to-buffer (current-buffer))) >> >> This recipe doesn't include the call to scroll-up, so I'm unsure how >> you did that and what you saw. When I try "M-: (scroll-up) RET" or >> "M-x scroll-up RET", I get several scrolls by window-size, and then >> "End of buffer" error when I hit the end of the buffer. If this is >> unexpected, please tell why. > > On my machine, I don't get "End of buffer" error. Correction - I *do* get "End of buffer" error, but only after fully scrolling past the image (which IMO is unexpected). > I tested three different ways in the following snippet > > (with-current-buffer (get-buffer-create "*test-scroll-image*") > (erase-buffer) > (insert-image (create-image "splash.png" nil nil > ;; Scale the image more if it doesn't take up the whole window. > :scale 5)) > (goto-char (point-max)) > (pixel-scroll-precision-mode -1) ; Ensure mouse wheel scroll up and down works > (pop-to-buffer (current-buffer))) > > 1. "M-: (scroll-up) RET" (repeatedly) > 2. C-v (repeatedly) > 3. (repeatedly) > > With all three methods, at first Emacs gradually scrolls the image, but > then when I reach the bottom of the image, the image disappears entirely > as Emacs scrolls past it all at once. > >>> Even more unexpectedly, when point is before the image, running >>> `scroll-up' repeatedly eventually scrolls back to the top of the image: >>> >>> (with-current-buffer (get-buffer-create "*test-scroll-image*") >>> (erase-buffer) >>> (insert-image (create-image "splash.png" nil nil :scale 5)) >>> (goto-char (point-min)) >>> (pop-to-buffer (current-buffer))) >> >> I do see this, but why is that a problem? You supposed to use >> scroll-up-command instead, which handles these marginal cases much >> better. scroll-up itself is not smart enough to avoid the perceived >> "scroll back to top", which is actually caused by the fact that we >> zero out window-vscroll (which is how we handle scrolling past large >> images). > > You're right. This is not a problem in practice. When point is before > the image, both C-v and produce the same behavior as above. > > Joseph