From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 11:23:18 +0200 Message-ID: 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> Reply-To: martin rudalics Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23638"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: luangruo@yahoo.com, 70038@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 15 11:24:09 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 1rwIZM-00060w-EE for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Apr 2024 11:24:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwIZ6-0003E5-CX; Mon, 15 Apr 2024 05:23:52 -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 1rwIZ4-0003Bt-A1 for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 05:23:50 -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 1rwIZ4-0001M7-2V for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 05:23:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rwIZF-00072E-LU for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 05:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Apr 2024 09:24:01 +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.171317302426891 (code B ref 70038); Mon, 15 Apr 2024 09:24:01 +0000 Original-Received: (at 70038) by debbugs.gnu.org; 15 Apr 2024 09:23:44 +0000 Original-Received: from localhost ([127.0.0.1]:36680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwIYv-0006zG-Iz for submit@debbugs.gnu.org; Mon, 15 Apr 2024 05:23:43 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:46333) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwIYt-0006y3-B8 for 70038@debbugs.gnu.org; Mon, 15 Apr 2024 05:23:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1713172999; x=1713777799; i=rudalics@gmx.at; bh=vgqOJq6GAtekRgfO6J0opuQuykmpGYHLamdKXnVoeh0=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=XuEq1WkdQcQLIHmhqFAJ+9KYEufOVKL8CO7aF0hLaEKrwZpr3D+vKpCOYHIbaZMt 4VOuV1Yxkbr0gVKEQtnRFzn8OU3HUuWp5/bATxWOo0g3L3Ysiibvb1497xnaoNqUm 4fEw++Knfnb5Z8ZJQD2P+691RTq3G+f5k49NYPmrLMfFz87cQiExh3R+DjRdNy22M yNSdgs3AKVObFzv9GEB69fvirRJ5G2m9bprm3pn1gLw+4kCiHa6koNH/5nDBQXz6v hVCFPWxYlVx/jJNpmjtffzAL+KUqm4ciy8VF+VvD2ChZqz0+5C7hBlB8P0xOZZoYu agFImfeXrCzCeIUYvQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([213.142.97.91]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MeCpb-1sV5TU2FHz-00bKKx; Mon, 15 Apr 2024 11:23:19 +0200 Content-Language: en-US In-Reply-To: <865xwknvhs.fsf@gnu.org> X-Provags-ID: V03:K1:LksHBfxyBCfXcBJVF3OTGzW7uyK/P9Xm1zFKat5Oibd8mW4jEhs 9MsEcClWmBwcIbfMTsNtdLfp+xAahvSdrUfAcYA7uzSyv55/gwup48YbnergPd8LCoaKg8L cOsw1zpgFWp8By6bOtUfJgm07zih7wB8zpb/kaBCjaRWF4XlggALYVPxLUM90hXGEgoy/nV Kiu3v5WWaMTUb0VagCg6Q== UI-OutboundReport: notjunk:1;M01:P0:Dls/FeV2s/s=;JRP+qgHc2wQjV6nj7r/QtKhi6ar pMhn6Iu1hyikSTuEydQ4KtRhP0EvnnqqetNmqT5vclVmBvd+C1hb+maribsx+El1uYZQatV3E jgyBPV1IcMdFRy2dEvVcrwFOctAqz8j8EEFwrXrLb0zzky5pqtCk63w1aaUDmfEroAzv5Oho1 oaXFThzAZ0eROTSKgLqRxzdCRFlbrsozbZcZhgTMh8W4jTDbDrVsEzYWTwP99s64hiwn4AZ+4 4JSy2eUINi+bMd5mUBGP8WkdSRAyOKVte0wnYh70MLH4LY/AaDxJ4pfCJsFeSdSMkl3Q6dEYF vhbeZnpsooKqHhyPcVN+1PUOMpuCjXm6sPyy2Tsejrw2h2ljyh9dR5OGkDyads4cawCkP7EP5 35HycXkPdcYf2QNwbSK6p6vc5dOEd/2VUcN3ZYD1a1ncWiqzbdOizQB3KMPGLfjAHNA4JJ20C WJwefMEYNO9RZPqVZWBRmxZiYOD9GwZprNSUsUjvQ5/BSXmOMfS+yhnqst/UL/d3HAB96eqUn PQnmeVMxNwIpDOm/1aitYYY8mPQmZwegtih3ReQTOnHqhaBDeRSib/pp4IHfK+aNKETW9a90P PcsPBbBB26hgk1ut1IgNs0lU9xXiWNNBHDnqVB6fMcdO9GaU2o7XH7iOCP0MwD3C9JywmLpF0 J+Z18YaS9bGh4J2OyYRSU7pIcVJfKDqSJ9LDWUL6t2exXDfHQrBCk1C+PX+4Kx5MefnufoZs7 oKWE+UPzPRpfjlFRGXWk6Nc2ztVB5YYYVDt9fxnAkkMn/bQY4FrfSQ6ckIpbIhSdvIsMmePP 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:283350 Archived-At: > Did I succeed explaining the issue? Not yet. 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? So what, if possibly, could motivate Emacs to "willfully" change a start position? 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 ... 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? > Is that in addition to what I suggested to do in shrink_mini_window? It should replace it. > 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. martin diff --git a/src/window.c b/src/window.c index fe26311fbb2..34d0def7d72 100644 --- a/src/window.c +++ b/src/window.c @@ -5376,7 +5376,6 @@ grow_mini_window (struct window *w, int delta) struct window *r = XWINDOW (root); Lisp_Object grow; - FRAME_WINDOWS_FROZEN (f) = true; grow = call3 (Qwindow__resize_root_window_vertically, root, make_fixnum (- delta), Qt); @@ -5390,6 +5389,9 @@ grow_mini_window (struct window *w, int delta) && window_resize_check (r, false)) resize_mini_window_apply (w, -XFIXNUM (grow)); } + + FRAME_WINDOWS_FROZEN (f) + = window_body_height (w, WINDOW_BODY_IN_PIXELS) > FRAME_LINE_HEIGHT (f); } /** @@ -5413,7 +5415,6 @@ shrink_mini_window (struct window *w) struct window *r = XWINDOW (root); Lisp_Object grow; - FRAME_WINDOWS_FROZEN (f) = false; grow = call3 (Qwindow__resize_root_window_vertically, root, make_fixnum (delta), Qt); @@ -5425,6 +5426,8 @@ shrink_mini_window (struct window *w) bar. */ grow_mini_window (w, -delta); + FRAME_WINDOWS_FROZEN (f) + = window_body_height (w, WINDOW_BODY_IN_PIXELS) > FRAME_LINE_HEIGHT (f); } DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal,