From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70038: 29.3.50; Shift up/down in buffer with images on M-x other-window with some fonts Date: Mon, 15 Apr 2024 16:54:20 +0300 Message-ID: <86bk6aloj7.fsf@gnu.org> References: <87ttkrl8w1.fsf@gmail.com> <86zfuihp7t.fsf@gnu.org> <87bk6yl4hu.fsf@gmail.com> <8734sal2bc.fsf@gmail.com> <87wmpm2rd7.fsf@zohomail.eu> <86bk6m3c20.fsf@gnu.org> <867cha37of.fsf@gnu.org> <3ee13fbd-2ba0-4fca-b5ed-b61f1d8dc527@gmx.at> <864jcd1qok.fsf@gnu.org> <8634rx1kfb.fsf@gnu.org> <028e677b-6d6b-42b2-95ac-0e0c5d1f3dd1@gmx.at> <86jzl1po87.fsf@gnu.org> <865xwknvhs.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36306"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, 70038@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 15 15:56:20 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 1rwMom-0009BP-G5 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Apr 2024 15:56:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwMoT-0002eb-3c; Mon, 15 Apr 2024 09:56:01 -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 1rwMoR-0002eH-5o for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 09:55:59 -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 1rwMoQ-0007Kj-N3 for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 09:55:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rwMob-0002kI-SC for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 09:56:09 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Apr 2024 13:56:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70038 X-GNU-PR-Package: emacs Original-Received: via spool by 70038-submit@debbugs.gnu.org id=B70038.17131893079880 (code B ref 70038); Mon, 15 Apr 2024 13:56:09 +0000 Original-Received: (at 70038) by debbugs.gnu.org; 15 Apr 2024 13:55:07 +0000 Original-Received: from localhost ([127.0.0.1]:37436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwMnQ-0002Xn-Lp for submit@debbugs.gnu.org; Mon, 15 Apr 2024 09:55:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwMnB-0002Ue-QW for 70038@debbugs.gnu.org; Mon, 15 Apr 2024 09:54:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwMmu-0006xe-Ie; Mon, 15 Apr 2024 09:54:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Ppy2HfUkypfMqNtR8u1QRMbdm5zOE4JYF2JoGN8cStA=; b=rRiXpukiKdx5 fM2XBUlPl3wtgY+60S2NtwP3sQ4oiJoDXKwy7LpBWXszRWAe6sixqR+Elou4+5CI0KTmIj3UG4eYr byAYeQesftZzXpkVuETkpJ4SibIjlQ6SIWLmbQnnnb/GeIe3aprVkwyW0NOJFJ9KxGOi9yqVH1DV4 l0QN4pfmrTrtEBNv/Kmb6QwVG5D0nw2Pe3kFDAs5dLmn6vu1y6w73BaqOYAYMZWqPStXBsM21Di3+ giQ2LzDgUfDBT7jI6V5MY6ek4V17B80Q9GzWgVLSJJ6/F1O0X5qbofPNbtw4OHwCAUjX0ly9iOyc+ 0ImA9NM8hELcEezeuPBrGQ==; In-Reply-To: (message from martin rudalics on Mon, 15 Apr 2024 11:23:18 +0200) 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:283374 Archived-At: > Date: Mon, 15 Apr 2024 11:23:18 +0200 > Cc: luangruo@yahoo.com, 70038@debbugs.gnu.org > From: martin rudalics > > > Did I succeed explaining the issue? > > Not yet. You asked what harm could unnecessarily frozen window-start do, and I explained that: it causes us to run more expensive code. Now you are asking a different question: why do we freeze window-start points at all? Let me try to answer that as well. > When we freeze window starts in the case at hand we do that to > approximate the behavior of a 'save-window-excursion'. But doesn't > Emacs always try to preserve window start positions regardless of > whether it enlarges or shrinks a window? It does, but what it will do if the current window-start doesn't show point depends on whether or not we take the "force_start" path. See below. > So what, if possibly, could > motivate Emacs to "willfully" change a start position? For example, if point is not visible in the window, or is on a screen line that is only partially visible, or is inside the scroll-margin. > It's obvious that > 'recenter' asks for it and sets optional_new_start. It's already not > clear to me why 'delete-other-windows' should want it. So why treating > frozen starts like asking for new start positions is still a mystery to > me ... See above. Basically, anything that changes the window geometry can potentially cause us to want to move the window-start point. > I suppose that freezing should handle one situation only: Emacs enlarges > the mini window, shrinks another window for that purpose and - for a > reason that is still unclear to me as mentioned above - would like to > change that window's start position. To avoid that - Emacs will still > have to change the start position to avoid that point goes off-screen - > we set that flag. Now it seems obvious that shrinking the mini window > and thus enlarging another window cannot harm in this regard since > otherwise we couldn't have reset the flag when shrinking a mini window > as we did earlier. Is it about making the cursor line fully visible? Yes. More generally, if the force_start flag is NOT set, and using the current window-start doesn't produce point in a fully-visible screen line and out of the scroll margins, then Emacs will try to find a different window-start point (even recentering the window around point if nothing else works). By contrast, if the force_start flag _is_ set, Emacs will instead move point to bring it inside the window, without changing window-start. When the window-start is frozen, we quickly determine whether using the current window-start will leave point inside the window, and if so, we set the force_start flag ourselves, to prevent redisplay_window from changing window-start. I hope this is now more clear. > > Is that in addition to what I suggested to do in shrink_mini_window? > > It should replace it. Hmm... I don't like leaving shrink_mini_window without the reset. > > Also, shouldn't we do this instead: > > > >> - FRAME_WINDOWS_FROZEN (f) = true; > >> + FRAME_WINDOWS_FROZEN (f) = (old_height + delta > min_height) ? true : false; > > > > IOW, shouldn't we unfreeze only when resizing to the default one-line > > height? > > Since every enlarging of the mini window freezes starts again, this > shouldn't be necessary. But to make sure that we cover all possible > scenarios we could use the below. Thanks, I like this much better. Now installed on master.