GNU bug report logs - #56102
29.0.50; fit-frame-to-buffer's window-text-pixel-size calculation can be incorrect when only is set to vertically

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Aaron Jensen <aaronjensen@HIDDEN>; Keywords: patch; dated Mon, 20 Jun 2022 03:04:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) patch. Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 56102 <at> debbugs.gnu.org:


Received: (at 56102) by debbugs.gnu.org; 28 Jun 2022 14:53:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 28 10:53:14 2022
Received: from localhost ([127.0.0.1]:56035 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o6CaY-0006y8-2F
	for submit <at> debbugs.gnu.org; Tue, 28 Jun 2022 10:53:14 -0400
Received: from mail-pl1-f171.google.com ([209.85.214.171]:40750)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <aaronjensen@HIDDEN>) id 1o6CaW-0006xt-Fw
 for 56102 <at> debbugs.gnu.org; Tue, 28 Jun 2022 10:53:12 -0400
Received: by mail-pl1-f171.google.com with SMTP id b2so4295838plx.7
 for <56102 <at> debbugs.gnu.org>; Tue, 28 Jun 2022 07:53:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=ovxw5TBeFf2Vd8gnvo+E7LFPCXLzeV1rEgKTmS7epgs=;
 b=J55lqmfVN9gSBqZgCxfYOxlgXH6RgR9DcOOZQ3TpH68EGvzvQnmZKe2pnpAZ73H/+X
 NXA/EDJseGkXq6ElSV3/037tnJ6LAwllgLC4kxI8bPoZs7DmqNayXV4KS/gHayf6j3Ly
 Pk99M5UHrg7itxEEVaTWDczHwa1E4yigA9LO8Rlt5e70Jac1psgG3W4zcMvmRS2tEvt4
 p9lSrbnK28DOpPBrsQ/y4MFr1PCs4O84KxDbYTSZYMl90d6jI7ZGbXdJ074uTeTuVvir
 F37/UwOUtMKmNfHaK7qzZP4OZVTEfxeSJBp1bEMKO67iL4hfjO+7SsXxidlb9NOPaVqj
 IfvQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=ovxw5TBeFf2Vd8gnvo+E7LFPCXLzeV1rEgKTmS7epgs=;
 b=5zqKrE+qLkexJsFbwXzHyHQFPbSrFjVcoNYn8/1tEUNnCvaUVPbfgX6EdDxOqNO1Zt
 WHFys8I/zdIsJLslUw84rgyAnOFDnOeRbOhA2p/dojEMShxG/7HcMs9VLPLLCPlc49mK
 WBn3rNTWznBv3OA8T7scOSh/h2fh+el/ESXYhFs9d1cRPNRapCP2DUWoP34tXC+QBmD0
 2DBzeAo/mc0nbqo7HYl7w4h2/M0ByeYNMV9aFobYy5KXQYS740mGHvQ4cTEWeuxl/DFv
 Q5evK/d/ZIdyba1fqaK60SND+ik5pssTEkBu2UVt2IA/dUmNHguZE00iQTnMaUUypT/y
 n2oQ==
X-Gm-Message-State: AJIora8MkVGaVPTZxKZmS4cm21Q8B9dIThxhGuiY5D80FfXq+jxWh0fy
 ZZzi8tK32/9x7JbP9xBCtC3vjfBrE8XclUhu9+4=
X-Google-Smtp-Source: AGRyM1tKBr1Uw/BZbMrDJeYj6Kxym4UmLml1CjaLatmtHWEF5v+DqqTrGzr6v318MtfUFnBgOxAWSaln0weCF53oulc=
X-Received: by 2002:a17:90b:388e:b0:1ec:f6b6:f31f with SMTP id
 mu14-20020a17090b388e00b001ecf6b6f31fmr27289136pjb.181.1656427986357; Tue, 28
 Jun 2022 07:53:06 -0700 (PDT)
MIME-Version: 1.0
References: <m2y1xsf34d.fsf@HIDDEN> <834k0ckdet.fsf@HIDDEN>
 <CAHyO48zHhO7uPHq2BBX7UnM_rXW-OBBN=pj=f6aTwx7Xi49dcg@HIDDEN>
 <0807c810-af05-f92c-17ce-991056906629@HIDDEN>
 <CAHyO48wccMewa6Am42mpJ+0q=wBkoGC_hSG+JOnk33n+qG3keA@HIDDEN>
 <62155072-ac5f-2a3d-b1dd-0c9363c74975@HIDDEN>
 <CAHyO48xEnb4RkAsOkMRegb4rfjMpGgL=hLToS9Scxzizy3Z8CQ@HIDDEN>
 <1a6138f1-fae9-4d33-28b4-7069028ccc36@HIDDEN>
 <CAHyO48wX27rFvTfd1jE5W-=9F3kNEQ6D2BU2xet_USwbiEkkCQ@HIDDEN>
 <aa2dd74a-5088-8f77-b003-e4ba5a9dc221@HIDDEN>
 <CAHyO48w2GC7VszD+-Q32T9QvKph2VjHOW7jY-ZDjAjA_Uma5LQ@HIDDEN>
 <a3153ffb-9e74-f680-642c-c1e64aa4651e@HIDDEN>
In-Reply-To: <a3153ffb-9e74-f680-642c-c1e64aa4651e@HIDDEN>
From: Aaron Jensen <aaronjensen@HIDDEN>
Date: Tue, 28 Jun 2022 10:52:55 -0400
Message-ID: <CAHyO48z_2stgqUZQ=sr_p7Eh1dHLm4Lm8CZrgUmHCd4Pfdsxxw@HIDDEN>
Subject: Re: bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size
 calculation can be incorrect when only is set to vertically
To: martin rudalics <rudalics@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56102
Cc: Eli Zaretskii <eliz@HIDDEN>, 56102 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Tue, Jun 28, 2022 at 5:29 AM martin rudalics <rudalics@HIDDEN> wrote:
>
>  >> I don't know yet either.  I'll send you a patch as soon as I have one.
>  >
>  > Sounds good, thanks.
>
> I suppose we can manage by fixing some trivial silliness in the code and
> making the documentation tell what the code does.  If you don't see any
> problems with the attached diff within a week or so, I'll push it.

Great, works on first try. I'll run with it and report back if I have
any issues. Thank you.

Aaron




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.

Message received at 56102 <at> debbugs.gnu.org:


Received: (at 56102) by debbugs.gnu.org; 28 Jun 2022 09:29:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 28 05:29:27 2022
Received: from localhost ([127.0.0.1]:53956 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o67XD-00062a-Df
	for submit <at> debbugs.gnu.org; Tue, 28 Jun 2022 05:29:27 -0400
Received: from mout.gmx.net ([212.227.17.22]:40761)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1o67Wx-00061v-OB
 for 56102 <at> debbugs.gnu.org; Tue, 28 Jun 2022 05:29:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1656408545;
 bh=N/ON9dEckHQ2+HOx/zxGBn2UUYOjiPX8r8037siWRSc=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=Hz0RcUeIavbt4uRek5CVgIS5vB2kQdPTTzOMyILqTWwmD1kVXusZmG4Sv1tREAGjV
 SlKRbDguUSS3KlQ+Ozty46oyvXvMkwdCANUfN6etPCtAWB8ym0jgkWTwqRNPiewhcX
 zc6SGwnx3pG+nA6FCk0e+aBad5A5UKv/hSWgYfOQ=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.102] ([212.95.5.160]) by mail.gmx.net (mrgmx105
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N6sit-1nZmxz3qU3-018NNC; Tue, 28
 Jun 2022 11:29:05 +0200
Content-Type: multipart/mixed; boundary="------------aDIhJELPCU0l4lDbzbJPllRA"
Message-ID: <a3153ffb-9e74-f680-642c-c1e64aa4651e@HIDDEN>
Date: Tue, 28 Jun 2022 11:29:01 +0200
MIME-Version: 1.0
Subject: Re: bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size
 calculation can be incorrect when only is set to vertically
Content-Language: en-US
To: Aaron Jensen <aaronjensen@HIDDEN>
References: <m2y1xsf34d.fsf@HIDDEN> <834k0ckdet.fsf@HIDDEN>
 <CAHyO48zHhO7uPHq2BBX7UnM_rXW-OBBN=pj=f6aTwx7Xi49dcg@HIDDEN>
 <0807c810-af05-f92c-17ce-991056906629@HIDDEN>
 <CAHyO48wccMewa6Am42mpJ+0q=wBkoGC_hSG+JOnk33n+qG3keA@HIDDEN>
 <62155072-ac5f-2a3d-b1dd-0c9363c74975@HIDDEN>
 <CAHyO48xEnb4RkAsOkMRegb4rfjMpGgL=hLToS9Scxzizy3Z8CQ@HIDDEN>
 <1a6138f1-fae9-4d33-28b4-7069028ccc36@HIDDEN>
 <CAHyO48wX27rFvTfd1jE5W-=9F3kNEQ6D2BU2xet_USwbiEkkCQ@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6Cx0HJZydOQWje+bs5kyTbC4WPZ/NE5plEy+dSDPW4bWIwvy
 U2RiR483zJFfdRta908u7OZjTLubRvavujkqvee3O6EZG3AwhgJmYML2yNz0NzlYv3QZb2vQG
 iuorR2rU9B+jK0iMxeQY4ny12PhdmzI5AWpTp7q/N+QEH4o8vOXi8HSagWi7sXJ+RI7Qrc8QD
 eDO9wh70bxldSIZJv4RzCrpRiSx119nq/rzOnwpoLFdB3ue82habEuQw8On+bu+7+UlvzqzX3
 jbChSyb/km668AoY8g4CH0cQt+vUcBI6qgMULLs2jZSMG9tPd4tClT3cTv+ZYUxhYChz66mCw
 LPYM+n9J+J+pvuFNzGLz3IlL/XYc6wC4zG5k3++R6cpPTa0Vr7TBOI33NpxjK2iRC0P/78yeZ
 X972lVmAquJv+pBG1XsUARt2ZIpCJOsUxRxSmg1D/EhflyK5NtbV3vsGaFHtlgjU5//JxeZai
 nChURiUXq0h9a1jQquRhrcmbSfie9VIqPs99JXlUpAM75frJ8pNkXWiKbQ0o3Y6LywQAdoveZ
 9fVyiFAdH3HDogdYMB6YkfBxDTUzZG2H1NDkzHOu6oxCJEhbY51B/5K0w==
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 56102
Cc: Eli Zaretskii <eliz@HIDDEN>, 56102 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

This is a multi-part message in MIME format.
--------------aDIhJELPCU0l4lDbzbJPllRA
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

 >> I don't know yet either.  I'll send you a patch as soon as I have one.
 >
 > Sounds good, thanks.

I suppose we can manage by fixing some trivial silliness in the code and
making the documentation tell what the code does.  If you don't see any
problems with the attached diff within a week or so, I'll push it.

Thanks, martin
--------------aDIhJELPCU0l4lDbzbJPllRA
Content-Type: text/x-patch; charset=UTF-8; name="fit-frame-to-buffer.diff"
Content-Disposition: attachment; filename="fit-frame-to-buffer.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL2RvYy9saXNwcmVmL3dpbmRvd3MudGV4aSBiL2RvYy9saXNwcmVmL3dp
bmRvd3MudGV4aQppbmRleCBlMDcwZTg0YzY3Li42YTZjOTFlMzU2IDEwMDY0NAotLS0gYS9k
b2MvbGlzcHJlZi93aW5kb3dzLnRleGkKKysrIGIvZG9jL2xpc3ByZWYvd2luZG93cy50ZXhp
CkBAIC0xMTUxLDEwICsxMTUxLDEyIEBAIFJlc2l6aW5nIFdpbmRvd3MKIGl0cyBidWZmZXIg
ZXhhY3RseS4gIEB2YXJ7ZnJhbWV9IGNhbiBiZSBhbnkgbGl2ZSBmcmFtZSBhbmQgZGVmYXVs
dHMgdG8KIHRoZSBzZWxlY3RlZCBvbmUuICBGaXR0aW5nIGlzIGRvbmUgb25seSBpZiBAdmFy
e2ZyYW1lfSdzIHJvb3Qgd2luZG93IGlzCiBsaXZlLiAgVGhlIGFyZ3VtZW50cyBAdmFye21h
eC1oZWlnaHR9LCBAdmFye21pbi1oZWlnaHR9LCBAdmFye21heC13aWR0aH0KLWFuZCBAdmFy
e21pbi13aWR0aH0gc3BlY2lmeSBib3VuZHMgb24gdG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cgc3lzdGVtcyB3aGVyZSB0aGUgbWVudWJhciBjYW4gd3Jh
cCwgZml0dGluZyBhIGZyYW1lIHRvCiBpdHMgYnVmZmVyIG1heSBzd2FsbG93IHRoZSBsYXN0
IGxpbmUocykuICBTcGVjaWZ5aW5nIGFuCkBAIC05MjUyLDMwICs5MjUzLDMwIEBAIGZpdC1m
cmFtZS10by1idWZmZXItMQogICAgICAgICAgICAgICAodCBwYXJlbnQtb3ItZGlzcGxheS1o
ZWlnaHQpKQogICAgICAgICAgICAgIDs7IFRoZSBmb2xsb3dpbmcgaXMgdGhlIG1heGltdW0g
aGVpZ2h0IHRoYXQgZml0cyBpbnRvIHRoZQogICAgICAgICAgICAgIDs7IHRvcCBhbmQgYm90
dG9tIG1hcmdpbnMuCi0gICAgICAgICAgICAgKG1heCAoLSBib3R0b20tbWFyZ2luIHRvcC1t
YXJnaW4gb3V0ZXItbWludXMtYm9keS1oZWlnaHQpKSkpCisgICAgICAgICAgICAgKG1heCAo
LSBib3R0b20tbWFyZ2luIHRvcC1tYXJnaW4gb3V0ZXItbWludXMtYm9keS1oZWlnaHQpIDAp
KSkKICAgICAgICAgICAgKG1pbi1oZWlnaHQKICAgICAgICAgICAgIChjb25kCiAgICAgICAg
ICAgICAgKChudW1iZXJwIG1pbi1oZWlnaHQpICgqIG1pbi1oZWlnaHQgbGluZS1oZWlnaHQp
KQogICAgICAgICAgICAgICgobnVtYmVycCAobnRoIDEgc2l6ZXMpKSAoKiAobnRoIDEgc2l6
ZXMpIGxpbmUtaGVpZ2h0KSkKLSAgICAgICAgICAgICAodCAod2luZG93LW1pbi1zaXplIHdp
bmRvdyBuaWwgbmlsIHQpKSkpCisgICAgICAgICAgICAgKHQgKHdpbmRvdy1zYWZlLW1pbi1z
aXplIHdpbmRvdyBuaWwgdCkpKSkKICAgICAgICAgICAgKG1heC13aWR0aAotICAgICAgICAg
ICAgKG1pbgotICAgICAgICAgICAgIChjb25kCi0gICAgICAgICAgICAgICgobnVtYmVycCBt
YXgtd2lkdGgpICgqIG1heC13aWR0aCBjaGFyLXdpZHRoKSkKLSAgICAgICAgICAgICAgKChu
dW1iZXJwIChudGggMiBzaXplcykpICgqIChudGggMiBzaXplcykgY2hhci13aWR0aCkpCi0g
ICAgICAgICAgICAgICh0IHBhcmVudC1vci1kaXNwbGF5LXdpZHRoKSkKLSAgICAgICAgICAg
ICA7OyBUaGUgZm9sbG93aW5nIGlzIHRoZSBtYXhpbXVtIHdpZHRoIHRoYXQgZml0cyBpbnRv
IHRoZQotICAgICAgICAgICAgIDs7IGxlZnQgYW5kIHJpZ2h0IG1hcmdpbnMuCi0gICAgICAg
ICAgICAgKG1heCAoLSByaWdodC1tYXJnaW4gbGVmdC1tYXJnaW4gb3V0ZXItbWludXMtYm9k
eS13aWR0aCkpKSkKKyAgICAgICAgICAgICh1bmxlc3MgKGVxIG9ubHkgJ3ZlcnRpY2FsbHkp
CisgICAgICAgICAgICAgIChtaW4KKyAgICAgICAgICAgICAgIChjb25kCisgICAgICAgICAg
ICAgICAgKChudW1iZXJwIG1heC13aWR0aCkgKCogbWF4LXdpZHRoIGNoYXItd2lkdGgpKQor
ICAgICAgICAgICAgICAgICgobnVtYmVycCAobnRoIDIgc2l6ZXMpKSAoKiAobnRoIDIgc2l6
ZXMpIGNoYXItd2lkdGgpKQorICAgICAgICAgICAgICAgICh0IHBhcmVudC1vci1kaXNwbGF5
LXdpZHRoKSkKKyAgICAgICAgICAgICAgIDs7IFRoZSBmb2xsb3dpbmcgaXMgdGhlIG1heGlt
dW0gd2lkdGggdGhhdCBmaXRzIGludG8gdGhlCisgICAgICAgICAgICAgICA7OyBsZWZ0IGFu
ZCByaWdodCBtYXJnaW5zLgorICAgICAgICAgICAgICAgKG1heCAoLSByaWdodC1tYXJnaW4g
bGVmdC1tYXJnaW4gb3V0ZXItbWludXMtYm9keS13aWR0aCkgMCkpKSkKICAgICAgICAgICAg
KG1pbi13aWR0aAogICAgICAgICAgICAgKGNvbmQKICAgICAgICAgICAgICAoKG51bWJlcnAg
bWluLXdpZHRoKSAoKiBtaW4td2lkdGggY2hhci13aWR0aCkpCi0gICAgICAgICAgICAgKChu
dW1iZXJwIChudGggMyBzaXplcykpIChudGggMyBzaXplcykpCi0gICAgICAgICAgICAgKHQg
KHdpbmRvdy1taW4tc2l6ZSB3aW5kb3cgdCBuaWwgdCkpKSkKKyAgICAgICAgICAgICAoKG51
bWJlcnAgKG50aCAzIHNpemVzKSkgKCogKG50aCAzIHNpemVzKSBjaGFyLXdpZHRoKSkKKyAg
ICAgICAgICAgICAodCAod2luZG93LXNhZmUtbWluLXNpemUgd2luZG93IHQgdCkpKSkKICAg
ICAgICAgICAgOzsgTm90ZTogQ3VycmVudGx5LCBmb3IgYSBuZXcgZnJhbWUgdGhlIHNpemVz
IG9mIHRoZSBoZWFkZXIKICAgICAgICAgICAgOzsgYW5kIG1vZGUgbGluZSBtYXkgYmUgZXN0
aW1hdGVkIGluY29ycmVjdGx5Ci0gICAgICAgICAgIChzaXplCi0gICAgICAgICAgICAod2lu
ZG93LXRleHQtcGl4ZWwtc2l6ZSB3aW5kb3cgZnJvbSB0byBtYXgtd2lkdGggbWF4LWhlaWdo
dCkpCisgICAgICAgICAgIChzaXplICh3aW5kb3ctdGV4dC1waXhlbC1zaXplIHdpbmRvdyBm
cm9tIHRvIG1heC13aWR0aCBtYXgtaGVpZ2h0KSkKICAgICAgICAgICAgKHdpZHRoIChtYXgg
KGNhciBzaXplKSBtaW4td2lkdGgpKQogICAgICAgICAgICAoaGVpZ2h0IChtYXggKGNkciBz
aXplKSBtaW4taGVpZ2h0KSkpCiAgICAgICA7OyBEb24ndCBjaGFuZ2UgaGVpZ2h0IG9yIHdp
ZHRoIHdoZW4gdGhlIHdpbmRvdydzIHNpemUgaXMgZml4ZWQK

--------------aDIhJELPCU0l4lDbzbJPllRA--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.

Message received at 56102 <at> debbugs.gnu.org:


Received: (at 56102) by debbugs.gnu.org; 27 Jun 2022 13:24:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 27 09:24:33 2022
Received: from localhost ([127.0.0.1]:50303 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o5ojB-0000c3-AO
	for submit <at> debbugs.gnu.org; Mon, 27 Jun 2022 09:24:33 -0400
Received: from mail-pl1-f178.google.com ([209.85.214.178]:44716)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <aaronjensen@HIDDEN>) id 1o5oj9-0000bm-AX
 for 56102 <at> debbugs.gnu.org; Mon, 27 Jun 2022 09:24:31 -0400
Received: by mail-pl1-f178.google.com with SMTP id l6so8145151plg.11
 for <56102 <at> debbugs.gnu.org>; Mon, 27 Jun 2022 06:24:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=LRaeJ/3iMidZpTsoaXEeadfwieBnbAfUyTtOecEF1Vg=;
 b=KcvXcAU56obSVMnPCcXQMBX5m0o++/MTzEnjjkh2gx/U5a/rO1sR2aVL8FEhoQqx+i
 7cM4gzbsuVmdwitlEyLV2lb9URrhaRLChzapm1q8XIxJyMD/672HPF02x1rtnXqqaeMk
 0Jj1PDhMM4cKoVL3pclk8Zpot59ZLrPT2a4KGvqPZ5Ofu7LBHbrEvkLl8ZJ3X6/V3J1g
 QRixgC5SSjEUuykJ7Ffy9k+OGssUiySQGXjBVB4C8Lszxe3JIDH7hLERJzsGlDGpDqE4
 Lb713w3BEdkgojOsLh1pTWkOi9Z9aTJXi70HW+wujduUc94B5+B33GhZYV+JCk8M0xX0
 RMlg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=LRaeJ/3iMidZpTsoaXEeadfwieBnbAfUyTtOecEF1Vg=;
 b=tR/iUGYXtK8lDl4vY8JUyFMHCTr+M6wLhsuD0S6kh6KHEfVDEUiJ/D2peJJivAzmuM
 vrqoM/CiHMJ2+I6VIWSrzlaExelCb9+Sk6X/JvCVkEo49Eb/vyAycYwGmcVqOPaNmQqw
 9xHNnH6FGHFGDo4DU6JEc3Jaw8lF7G5uK1+kIUzGNgs+f6ZfzK2jJwuvVz6mab7MAM3c
 rU25MsuCkayTePoanw75U907d3/4A4eruGhntGxYMNbASfDlZTPmYwH+qG9fME82K9zP
 q2mlVsTpNbv13mh1mabPfefNSDUh0n1TB6ei3mAQHA+WRadf8svdWYQuzasZ+xrHL+rg
 F+XA==
X-Gm-Message-State: AJIora9FU6duS8k7SuK0g6F0acOTwm/oON/d0zQKCar5J+Ok4S6kmhm9
 HlLBxS7Pca5WCElqwsUhII9kTCK5Dp3U8+1GVhc=
X-Google-Smtp-Source: AGRyM1tA9lAqgMTnoZdy+UPW7jfoGy7YmyRd+x4xvvtH0fpScCVw2FvegMI+b+1yg1iV3fytjO7jn94aDefLxGWmdFM=
X-Received: by 2002:a17:902:900c:b0:16a:4521:10fd with SMTP id
 a12-20020a170902900c00b0016a452110fdmr14620501plp.75.1656336265312; Mon, 27
 Jun 2022 06:24:25 -0700 (PDT)
MIME-Version: 1.0
References: <m2y1xsf34d.fsf@HIDDEN> <834k0ckdet.fsf@HIDDEN>
 <CAHyO48zHhO7uPHq2BBX7UnM_rXW-OBBN=pj=f6aTwx7Xi49dcg@HIDDEN>
 <0807c810-af05-f92c-17ce-991056906629@HIDDEN>
 <CAHyO48wccMewa6Am42mpJ+0q=wBkoGC_hSG+JOnk33n+qG3keA@HIDDEN>
 <62155072-ac5f-2a3d-b1dd-0c9363c74975@HIDDEN>
 <CAHyO48xEnb4RkAsOkMRegb4rfjMpGgL=hLToS9Scxzizy3Z8CQ@HIDDEN>
 <1a6138f1-fae9-4d33-28b4-7069028ccc36@HIDDEN>
 <CAHyO48wX27rFvTfd1jE5W-=9F3kNEQ6D2BU2xet_USwbiEkkCQ@HIDDEN>
 <aa2dd74a-5088-8f77-b003-e4ba5a9dc221@HIDDEN>
In-Reply-To: <aa2dd74a-5088-8f77-b003-e4ba5a9dc221@HIDDEN>
From: Aaron Jensen <aaronjensen@HIDDEN>
Date: Mon, 27 Jun 2022 09:24:14 -0400
Message-ID: <CAHyO48w2GC7VszD+-Q32T9QvKph2VjHOW7jY-ZDjAjA_Uma5LQ@HIDDEN>
Subject: Re: bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size
 calculation can be incorrect when only is set to vertically
To: martin rudalics <rudalics@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56102
Cc: Eli Zaretskii <eliz@HIDDEN>, 56102 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Mon, Jun 27, 2022 at 4:24 AM martin rudalics <rudalics@HIDDEN> wrote:
>
>  >> With a non-standard setup, say
>  >> after doing
>  >>
>  >> (set-window-margins nil 10 10)
>  >>
>  >> in the root window, your fix will fail with the scenario you provided
>  >> earlier.
>  >
>  > Ah, I can confirm this. Is there a reasonable way for me to calculate
>  > a max-width that would be based on the root window that would work?
>
> Here
>
> (set-window-margins nil 10 10)
> (fit-frame-to-buffer nil nil nil (window-body-width) nil 'vertically)
>
> seems to work.

Thanks, I'll update the workaround to use this instead.

> I don't know yet either.  I'll send you a patch as soon as I have one.

Sounds good, thanks.

Aaron




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.

Message received at 56102 <at> debbugs.gnu.org:


Received: (at 56102) by debbugs.gnu.org; 27 Jun 2022 08:24:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 27 04:24:22 2022
Received: from localhost ([127.0.0.1]:49762 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o5k2f-0001mZ-Mk
	for submit <at> debbugs.gnu.org; Mon, 27 Jun 2022 04:24:21 -0400
Received: from mout.gmx.net ([212.227.15.19]:35507)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1o5k2d-0001mJ-IV
 for 56102 <at> debbugs.gnu.org; Mon, 27 Jun 2022 04:24:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1656318252;
 bh=pFpttb3qvI/lVcx+O60QU8aVhPKmOHUZCVmdvMnLtFI=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=YzhOb0ZnGWP+X8699GUjvQXzA3wox+UDEhmTRqX2ro2XG9KIz3FezwhBvveMjmA9Y
 l1pIZzyvE/n8wFFBg/kVKzazGv+Am+b39CdD7o1pgtxkfqtiZYjTjt+Oz06FGjbn6M
 iAyMVwm13DP3+wTzFJP07JNSoxVxVAJZIS2R02Yg=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.102] ([213.142.96.80]) by mail.gmx.net (mrgmx005
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N0FxV-1nlD5P0YLv-00xJNj; Mon, 27
 Jun 2022 10:24:12 +0200
Message-ID: <aa2dd74a-5088-8f77-b003-e4ba5a9dc221@HIDDEN>
Date: Mon, 27 Jun 2022 10:24:08 +0200
MIME-Version: 1.0
Subject: Re: bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size
 calculation can be incorrect when only is set to vertically
Content-Language: en-US
To: Aaron Jensen <aaronjensen@HIDDEN>
References: <m2y1xsf34d.fsf@HIDDEN> <834k0ckdet.fsf@HIDDEN>
 <CAHyO48zHhO7uPHq2BBX7UnM_rXW-OBBN=pj=f6aTwx7Xi49dcg@HIDDEN>
 <0807c810-af05-f92c-17ce-991056906629@HIDDEN>
 <CAHyO48wccMewa6Am42mpJ+0q=wBkoGC_hSG+JOnk33n+qG3keA@HIDDEN>
 <62155072-ac5f-2a3d-b1dd-0c9363c74975@HIDDEN>
 <CAHyO48xEnb4RkAsOkMRegb4rfjMpGgL=hLToS9Scxzizy3Z8CQ@HIDDEN>
 <1a6138f1-fae9-4d33-28b4-7069028ccc36@HIDDEN>
 <CAHyO48wX27rFvTfd1jE5W-=9F3kNEQ6D2BU2xet_USwbiEkkCQ@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <CAHyO48wX27rFvTfd1jE5W-=9F3kNEQ6D2BU2xet_USwbiEkkCQ@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:onO2+3F/F3QqVcggvl7HQ6v20eyRIxR6xN2NMhf9BKUzSRmz5uE
 0quf5+X0IThyyn/SKgRPp1OvQ0RSy4XfsxFfyY4+Wsq38iZTFkkVNYMbZe9SVuSPfIPF0xB
 FUHbwr2WKyATpkG3svd2uTbGR6l9Cws+lOSjUJqlj3zlAJEofGCh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ZyaFtP3NQXvdJoHyfI
 UEYcAkAPSOveos9PzgGN/rpTxjjZA4hLMsW0fuTmWotX7t4XTBungFayCwssXMJtf8/et9T2C
 7OZPMWb3FnA5Euixtlh0NGPbikFZwWYl1ItVZHqDXxgUWm4S+3NabbZqOtA4lynM3ZOXdQTMM
 DYph43thWsQZqD+dx08uYYp0ySE0WPJ4xxVh3s7mecE53ePt/D+LwvS8g==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 56102
Cc: Eli Zaretskii <eliz@HIDDEN>, 56102 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 >> With a non-standard setup, say
 >> after doing
 >>
 >> (set-window-margins nil 10 10)
 >>
 >> in the root window, your fix will fail with the scenario you provided
 >> earlier.
 >
 > Ah, I can confirm this. Is there a reasonable way for me to calculate
 > a max-width that would be based on the root window that would work?

Here

(set-window-margins nil 10 10)
(fit-frame-to-buffer nil nil nil (window-body-width) nil 'vertically)

seems to work.

 > There's other math that happens within fit-frame-to-buffer I don't
 > fully have my head wrapped around yet. I'm not super worried about
 > this personally as I don't set window margins on this window.

Similar problems should happen when the fringe or scroll bar sizes of
the root window or its buffer differ from that of the frame.

 > The patch works for me and seems good. When you say if you come up
 > with a reasonable fix, could I ask what is unreasonable about the
 > patch you attached?

The current code interprets all its -HEIGHT and -WIDTH arguments as if
they were body sizes and not total sizes.  This at least contradicts the
doc-strings of 'fit-frame-to-buffer-sizes' and of 'fit-frame-to-buffer'
itself.  If I can fix the problem by rewriting the doc-strings to match
what the code does, I'll probably do that.  In general, you can't get
these right anyway when you allow specifications in terms of character
sizes and windows/frames may have non-integral sizes wrt these.

 > Regardless, if you do end up updating the fix to respect a supplied
 > max-width even if only vertically is supplied, I could always make an
 > Emacs version based decision on whether or not to pass the work-around
 > max-width in, and Emacs 29 is as good a version as any to stop passing
 > it in (people already on master will have to recompile, but that's
 > fine imo). So, I would be fine with the new patch going straight to
 > master, though as I mentioned I don't know what it would do
 > differently or why.

I don't know yet either.  I'll send you a patch as soon as I have one.

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.

Message received at 56102 <at> debbugs.gnu.org:


Received: (at 56102) by debbugs.gnu.org; 26 Jun 2022 13:12:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 26 09:12:50 2022
Received: from localhost ([127.0.0.1]:46939 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o5S4I-00034m-AS
	for submit <at> debbugs.gnu.org; Sun, 26 Jun 2022 09:12:50 -0400
Received: from mail-pg1-f171.google.com ([209.85.215.171]:41639)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <aaronjensen@HIDDEN>) id 1o5S4G-00034a-Ee
 for 56102 <at> debbugs.gnu.org; Sun, 26 Jun 2022 09:12:49 -0400
Received: by mail-pg1-f171.google.com with SMTP id 23so6670943pgc.8
 for <56102 <at> debbugs.gnu.org>; Sun, 26 Jun 2022 06:12:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=StXHGKGilhUutfdZcNrZqY+Hlbg/2uqknhB+UT3Od/8=;
 b=KRUgxj7drVjuX00fgjj2pFXlCxGpG1VSTA+VxUdlPSo4imJhXsD7mww8r9bcwc1Jes
 nSH0LPUWPKMZfyF/GNpb5TEK3psk8v2JdbTFm7tNQwbmCQmg1IdmAuzSueEQkV8NWlHI
 JCB6SiFS9DvqnaaFzJvpoDSLDrqU3mkaJ8qK7aqSNNLqTw5qzcKNe8kQWfTrEFfdfT6x
 ULmAGA1m67pR2osWYQcvrvFeZfteucMGILQmXFnTn0CmT1Rz5JN0xkWKHuAU2m9faEEb
 mKTEOmMiYRqIIeeSj1KUz+085KjJMvv7tdkO7BgJ1fJKPOJs4B+g8Qy/+MnGCIFrdAeW
 wMOA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=StXHGKGilhUutfdZcNrZqY+Hlbg/2uqknhB+UT3Od/8=;
 b=vQxUrFd61rChLQg7Mp2GTE/rbQDF/KZWlzLIlHyeX9ctiHFDlMTCtngCzRfKDIkDex
 nX6RWhG+o+xMSozotDsXOjt7f9w27YjWLNQZz4b3z5lSet7tmYyLQ1WirCdUjUzAC2Wm
 lKo4P6jU6i4jypKZKhm+mLsp8tLGP/gE3lPGapcti26u0zD57twGr0WWSxPmRGo2i2r0
 XlNYaYGQ3ki3ZtcO9Wggkih2AO59FtxNZ54KhopwNbGGghF2Qn/FF+A4wQm+nAkjDCRB
 sDovUla2vNdJ8NKGs/aV2BAn8zGulE1ChhfufdbcmdVD4krHW2mT3qoX4lQtEHVF4wrz
 QikQ==
X-Gm-Message-State: AJIora9bHwgBmsFCLj4CDJYG+i4km9h3XevAspgmjxc57BSs6ssLpIpU
 zE2SVbbvK/uMNDqEhSKsesz5uXIveyIa7GlwSRg=
X-Google-Smtp-Source: AGRyM1uzDfDvWoVBjs3TysjfN/Vmbykxn95KrjrU4b19xxmdnNVs8ic0rDZI9o/AuDQ/UdAzjVbxoI1n3PZgTMdLN4s=
X-Received: by 2002:a63:3ec6:0:b0:40d:27a:7847 with SMTP id
 l189-20020a633ec6000000b0040d027a7847mr7934408pga.606.1656249162517; Sun, 26
 Jun 2022 06:12:42 -0700 (PDT)
MIME-Version: 1.0
References: <m2y1xsf34d.fsf@HIDDEN> <834k0ckdet.fsf@HIDDEN>
 <CAHyO48zHhO7uPHq2BBX7UnM_rXW-OBBN=pj=f6aTwx7Xi49dcg@HIDDEN>
 <0807c810-af05-f92c-17ce-991056906629@HIDDEN>
 <CAHyO48wccMewa6Am42mpJ+0q=wBkoGC_hSG+JOnk33n+qG3keA@HIDDEN>
 <62155072-ac5f-2a3d-b1dd-0c9363c74975@HIDDEN>
 <CAHyO48xEnb4RkAsOkMRegb4rfjMpGgL=hLToS9Scxzizy3Z8CQ@HIDDEN>
 <1a6138f1-fae9-4d33-28b4-7069028ccc36@HIDDEN>
In-Reply-To: <1a6138f1-fae9-4d33-28b4-7069028ccc36@HIDDEN>
From: Aaron Jensen <aaronjensen@HIDDEN>
Date: Sun, 26 Jun 2022 09:12:31 -0400
Message-ID: <CAHyO48wX27rFvTfd1jE5W-=9F3kNEQ6D2BU2xet_USwbiEkkCQ@HIDDEN>
Subject: Re: bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size
 calculation can be incorrect when only is set to vertically
To: martin rudalics <rudalics@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56102
Cc: Eli Zaretskii <eliz@HIDDEN>, 56102 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sun, Jun 26, 2022 at 6:09 AM martin rudalics <rudalics@HIDDEN> wrote:
> But actually it is the _body_ size of FRAME's root window the current
> code constrains.  Incidentally, the default body width of a live root
> window equals the value of FRAME's width parameter (the native width of
> the frame minus the widths of the internal border, the scroll bar and
> the fringes) which makes your fix work.  With a non-standard setup, say
> after doing
>
> (set-window-margins nil 10 10)
>
> in the root window, your fix will fail with the scenario you provided
> earlier.

Ah, I can confirm this. Is there a reasonable way for me to calculate
a max-width that would be based on the root window that would work?
There's other math that happens within fit-frame-to-buffer I don't
fully have my head wrapped around yet. I'm not super worried about
this personally as I don't set window margins on this window.


> We could try the following: If the new diff I attach now works for you,
> I'll push it to master.  If after some period of grace (whose length you
> determine) I manage to come up with a reasonable fix, I'll push that to
> master too and you and your clients will have to adapt.  WDYT?

The patch works for me and seems good. When you say if you come up
with a reasonable fix, could I ask what is unreasonable about the
patch you attached?

Regardless, if you do end up updating the fix to respect a supplied
max-width even if only vertically is supplied, I could always make an
Emacs version based decision on whether or not to pass the work-around
max-width in, and Emacs 29 is as good a version as any to stop passing
it in (people already on master will have to recompile, but that's
fine imo). So, I would be fine with the new patch going straight to
master, though as I mentioned I don't know what it would do
differently or why.

Thanks,

Aaron




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.

Message received at 56102 <at> debbugs.gnu.org:


Received: (at 56102) by debbugs.gnu.org; 26 Jun 2022 10:09:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 26 06:09:39 2022
Received: from localhost ([127.0.0.1]:46749 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o5PD1-0000HF-L1
	for submit <at> debbugs.gnu.org; Sun, 26 Jun 2022 06:09:39 -0400
Received: from mout.gmx.net ([212.227.15.15]:40161)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1o5PCw-0000Gz-Pe
 for 56102 <at> debbugs.gnu.org; Sun, 26 Jun 2022 06:09:38 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1656238168;
 bh=zFEcCp6cNFqGws8EmYWTsi26yd3T+s7V83ngOhIUiNM=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=bBJeGLiKzpbPvp1JXLlEdDudSrzWP98t+2Du7a7rvhl8EbbcSiiyQm4gETNDyi6sR
 NlrrTk766/Or2IMZjXky2v1m3/noyGAmXf67617bAtLVYCFvYSvyngLzcJhah8memu
 Km4EtjKBzBQ+OGwsi4SqtjTcxRIh/xbkIVEP1baQ=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.102] ([212.95.7.239]) by mail.gmx.net (mrgmx005
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M1psI-1o3DLj3LNw-002JMB; Sun, 26
 Jun 2022 12:09:28 +0200
Content-Type: multipart/mixed; boundary="------------3wc0XVDxq7eNLe0CDjCpgDcy"
Message-ID: <1a6138f1-fae9-4d33-28b4-7069028ccc36@HIDDEN>
Date: Sun, 26 Jun 2022 12:09:25 +0200
MIME-Version: 1.0
Subject: Re: bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size
 calculation can be incorrect when only is set to vertically
Content-Language: en-US
To: Aaron Jensen <aaronjensen@HIDDEN>
References: <m2y1xsf34d.fsf@HIDDEN> <834k0ckdet.fsf@HIDDEN>
 <CAHyO48zHhO7uPHq2BBX7UnM_rXW-OBBN=pj=f6aTwx7Xi49dcg@HIDDEN>
 <0807c810-af05-f92c-17ce-991056906629@HIDDEN>
 <CAHyO48wccMewa6Am42mpJ+0q=wBkoGC_hSG+JOnk33n+qG3keA@HIDDEN>
 <62155072-ac5f-2a3d-b1dd-0c9363c74975@HIDDEN>
 <CAHyO48xEnb4RkAsOkMRegb4rfjMpGgL=hLToS9Scxzizy3Z8CQ@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <CAHyO48xEnb4RkAsOkMRegb4rfjMpGgL=hLToS9Scxzizy3Z8CQ@HIDDEN>
X-Provags-ID: V03:K1:f4mHR0LIlccREM0ZwAiaLumecvig4jfYrkqfrUBIml0HukXXlSZ
 b0BlIGaG+NxhAYrfhVLnZ0dX96NSRLX6cA4JpsEXYkfA4Sv4Pkyu7vKGtKvHNmIveIE2wLp
 /TjfWFK6j68cQzIjuMeO1Q/WFfHSl08BiJwJ6dT55i7adR6VqsWAYcDEM2sf5puhOp840Ae
 hDW0eRQoVMRMAJ8vrdraQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:b58sFS2fCWM=:0gm5gXWLTIZj0I45gnQh0+
 M/qEwAwELGvduBVPAUuy9RLTEn0SxKe/2FlNlHTtuMYJyD1WS7zlTBNnRkpNp2gN3NqPcWp/x
 9FgN2gdIGU7h8uyptgp70IiRmvyCitz+rxu946rKUharaWfndesCtpQ4u9w+nsyZ/1sUpJwnm
 QLKvT9g3YZxCB2PaBR/swiRXSwCqTl5G71w94Fwdj0D84OMcKtE06xPYwwJS51tcuaOrSjo5X
 oxY7277P1oyqx0vTGLDeuxyY/eYJB8f5BBNpP7OI7elcXJhbxC+Fhk/OIgEN5HE0gKcmqaLoA
 rhYvoXAkwcBEfp2mNwlg0Q5zabvgH7nnAjSSEoAHZfw/mpio6+LBXljBPWyI/3CE+6fCr51ET
 OwMAqh8uH+5pwgz6uvG6Fb9/YBlr35R+7ZNzfuho1PfMUDlm7xrO5XjuGuLm90MYR3diVy1fZ
 GBf6JWVBolrn8eVJG6KvKdibrFqO7QJ7NDE9swcKOTu4y1ftvrCIWiYwx3Zh4p70Mn6Cd9e7Z
 S7uYj9JzfRKHlYKxWv538jvBpbxrzNc4Hi4pvqirX62YsIZTdcdyg9Cvk/CTeTT5bVUjKFWW4
 xjIaYhfHa8iyBktPWcMp50yoPZq5Jm1ngAFPWncrGc5x/1iTxr6d2HYXR5pxYFEf9ZeLBZOQ2
 yc5zosHUgPSnsDyAa8W/XcWkNF0rNyeBeNyVNFppLhsvJS98v2TU793qwqkLgFiVXXfzH8vQW
 n9MB/PYa+JoTnku72KWk1ihmt4DjkyCa6mj39TokqaafNprl7boEgEs3k63OyyHHraT/6zTvs
 Nnv5wEy5pfbk/NNwdYrE5LV5YdWoomR//rzFJbBVQ1+By+nb/60kb+HdDhMITZVGmLjk9TyQX
 Kn0+6+ty5KLUXl5roa8X3p+KRUPA8CGErsXiArNESGAmofpVz++UYv4FZiM62zWaMuLmaL0xi
 hg4WHeYcVTbQnPhrOJE+LCJDG9PF+lDEKHeHqMu05rwjBG0PkoJnO94G0v+EFw3HoKeIIAqys
 NXunykxHShQHTz9NkvBe82pKiKpigK5fdqtBUmYWHPMHDozNR4VZqRcX3OJKteZYvjEA0SdbT
 hNrO1NbK3YBnvfYi5XMta5eUdEldSOR6QQwG0kDBAtucfJJ26A5iEHaSw==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 56102
Cc: Eli Zaretskii <eliz@HIDDEN>, 56102 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

This is a multi-part message in MIME format.
--------------3wc0XVDxq7eNLe0CDjCpgDcy
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

ID4gSWYgSSBzYXkgdGhhdCBJIG9ubHkgd2FudCBpdCB0byBzY2FsZSB2ZXJ0aWNhbGx5LCBJ
IHdvdWxkDQogPiBleHBlY3Qgbm8gd2lkdGggY2hhbmdlcyB0byBvY2N1ciwgd2hpY2ggbWVh
bnMgSSB3b3VsZCBleHBlY3QgdGhhdA0KID4gbWF4LXdpZHRoIGFuZCBhbnl0aGluZyBlbHNl
IHdpZHRoIHJlbGF0ZWQgd291bGQgbm90IGJlIHJlbGV2YW50Lg0KDQpTb3VuZHMgcmVhc29u
YWJsZS4NCg0KID4gTXkgY29uY2VybiB3YXMgdGhpczoNCiA+DQogPj4gQWxzbywgdGhlIHNp
emVzIG9mIGZyYW1lIGFuZCB3aW5kb3cgZGVjb3JhdGlvbnMgd291bGQgaGFyZGx5IG1hdGNo
Lg0KID4NCiA+IEVmZmVjdGl2ZWx5LCB0aGF0IHRoZXJlIHdvdWxkIGJlIHNvbWUgc3VidGxl
IGRpZmZlcmVuY2UgYmV0d2VlbiB1c2luZw0KID4gKGZyYW1lLXBhcmFtZXRlciB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cnkgdGhlIGZvbGxvd2luZzogSWYgdGhlIG5ldyBkaWZmIEkg
YXR0YWNoIG5vdyB3b3JrcyBmb3IgeW91LA0KSSdsbCBwdXNoIGl0IHRvIG1hc3Rlci4gIElm
IGFmdGVyIHNvbWUgcGVyaW9kIG9mIGdyYWNlICh3aG9zZSBsZW5ndGggeW91DQpkZXRlcm1p
bmUpIEkgbWFuYWdlIHRvIGNvbWUgdXAgd2l0aCBhIHJlYXNvbmFibGUgZml4LCBJJ2xsIHB1
c2ggdGhhdCB0bw0KbWFzdGVyIHRvbyBhbmQgeW91IGFuZCB5b3VyIGNsaWVudHMgd2lsbCBo
YXZlIHRvIGFkYXB0LiAgV0RZVD8NCg0KbWFydGluDQo=
--------------3wc0XVDxq7eNLe0CDjCpgDcy
Content-Type: text/x-patch; charset=UTF-8; name="fit-frame-to-buffer.diff"
Content-Disposition: attachment; filename="fit-frame-to-buffer.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL2xpc3Avd2luZG93LmVsIGIvbGlzcC93aW5kb3cuZWwKaW5kZXggZWJh
ODg4YTg5ZC4uOTMzM2YwMzgyMiAxMDA2NDQKLS0tIGEvbGlzcC93aW5kb3cuZWwKKysrIGIv
bGlzcC93aW5kb3cuZWwKQEAgLTkzODUsMTQgKzkzODUsMTUgQEAgZml0LWZyYW1lLXRvLWJ1
ZmZlci0xCiAgICAgICAgICAgICAgKChudW1iZXJwIChudGggMSBzaXplcykpICgqIChudGgg
MSBzaXplcykgbGluZS1oZWlnaHQpKQogICAgICAgICAgICAgICh0ICh3aW5kb3ctbWluLXNp
emUgd2luZG93IG5pbCBuaWwgdCkpKSkKICAgICAgICAgICAgKG1heC13aWR0aAotICAgICAg
ICAgICAgKG1pbgotICAgICAgICAgICAgIChjb25kCi0gICAgICAgICAgICAgICgobnVtYmVy
cCBtYXgtd2lkdGgpICgqIG1heC13aWR0aCBjaGFyLXdpZHRoKSkKLSAgICAgICAgICAgICAg
KChudW1iZXJwIChudGggMiBzaXplcykpICgqIChudGggMiBzaXplcykgY2hhci13aWR0aCkp
Ci0gICAgICAgICAgICAgICh0IHBhcmVudC1vci1kaXNwbGF5LXdpZHRoKSkKLSAgICAgICAg
ICAgICA7OyBUaGUgZm9sbG93aW5nIGlzIHRoZSBtYXhpbXVtIHdpZHRoIHRoYXQgZml0cyBp
bnRvIHRoZQotICAgICAgICAgICAgIDs7IGxlZnQgYW5kIHJpZ2h0IG1hcmdpbnMuCi0gICAg
ICAgICAgICAgKG1heCAoLSByaWdodC1tYXJnaW4gbGVmdC1tYXJnaW4gb3V0ZXItbWludXMt
Ym9keS13aWR0aCkpKSkKKyAgICAgICAgICAgICh1bmxlc3MgKGVxIG9ubHkgJ3ZlcnRpY2Fs
bHkpCisgICAgICAgICAgICAgIChtaW4KKyAgICAgICAgICAgICAgIChjb25kCisgICAgICAg
ICAgICAgICAgKChudW1iZXJwIG1heC13aWR0aCkgKCogbWF4LXdpZHRoIGNoYXItd2lkdGgp
KQorICAgICAgICAgICAgICAgICgobnVtYmVycCAobnRoIDIgc2l6ZXMpKSAoKiAobnRoIDIg
c2l6ZXMpIGNoYXItd2lkdGgpKQorICAgICAgICAgICAgICAgICh0IHBhcmVudC1vci1kaXNw
bGF5LXdpZHRoKSkKKyAgICAgICAgICAgICAgIDs7IFRoZSBmb2xsb3dpbmcgaXMgdGhlIG1h
eGltdW0gd2lkdGggdGhhdCBmaXRzIGludG8gdGhlCisgICAgICAgICAgICAgICA7OyBsZWZ0
IGFuZCByaWdodCBtYXJnaW5zLgorICAgICAgICAgICAgICAgKG1heCAoLSByaWdodC1tYXJn
aW4gbGVmdC1tYXJnaW4gb3V0ZXItbWludXMtYm9keS13aWR0aCkpKSkpCiAgICAgICAgICAg
IChtaW4td2lkdGgKICAgICAgICAgICAgIChjb25kCiAgICAgICAgICAgICAgKChudW1iZXJw
IG1pbi13aWR0aCkgKCogbWluLXdpZHRoIGNoYXItd2lkdGgpKQo=

--------------3wc0XVDxq7eNLe0CDjCpgDcy--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.

Message received at 56102 <at> debbugs.gnu.org:


Received: (at 56102) by debbugs.gnu.org; 24 Jun 2022 14:29:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 24 10:29:01 2022
Received: from localhost ([127.0.0.1]:43119 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o4kIv-0001GF-96
	for submit <at> debbugs.gnu.org; Fri, 24 Jun 2022 10:29:01 -0400
Received: from mail-pj1-f54.google.com ([209.85.216.54]:56044)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <aaronjensen@HIDDEN>) id 1o4kIt-0001G0-1y
 for 56102 <at> debbugs.gnu.org; Fri, 24 Jun 2022 10:29:00 -0400
Received: by mail-pj1-f54.google.com with SMTP id w24so2928357pjg.5
 for <56102 <at> debbugs.gnu.org>; Fri, 24 Jun 2022 07:28:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=FSJgTGNTJIJfXp0aqj3BJWZOieV5cvnsVNFUBVnWTOg=;
 b=KuQ1Vv1tUp245NSpUKgldqjl5qTZ7QYLSYaQXnLtE9oSJKOFhR8psUaTrCgWP6gNk+
 91aw9Z07foy5I6FcghAcLAA6BrBLQTUNZvkt1xWK92ulRhmL8BKWsgsNPAzQ3dbvAf98
 JAnuwcSu/c3phkZ0SKX93+I061fkjNZWDKLNh2Z7HRYt6VswOovCnG2+zb8GgHZbF24l
 Ic7n20cit+WTRjkJdZWSSpGlNLWzKQJreBOEig0MnyWhF4EXr745kxjnm7w8wpsmZwq1
 bnPRicOw/jVgtwsbfAYkVTvUBYY+YJAPFJbxOF3ot/k8w3jF/TkPf6P88fMi2jw58F+x
 kO7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=FSJgTGNTJIJfXp0aqj3BJWZOieV5cvnsVNFUBVnWTOg=;
 b=tIvEYwVweEOg9qqAZZimm+XxZa3Y3/NNrDXe+0XXKCSlBwCKHxH6jjknP//gZEF/kc
 TIY3YYMPtdg8Dpt4JB+EHPCpEET9zCSVQjO4JEoeKNP3B19fS0d7qpHBhAIYGbjZqZ3N
 hQ5rcGjPIMg6pkZElMs3mXah/611Scnis2+MkLPwloqGLF96piqSGO358yiSGbexeStC
 x/gQmD3AaQjmR+TDgiTQ19yQ3as9lgwNQ246a1Ayf36dzVBKXzV84ebNPc05XK46IMyl
 sGq0/uj+2bCL+PXxY7e+G/FVq57bjt7F5j+AycfKeKI7iGytYpGzHTie4gALJy4m8T5X
 F8ig==
X-Gm-Message-State: AJIora8AecQli5LCdSO4tyg50bZofeGVmfvv6rBmwTTb9OEgbPlOa5k7
 gufW/LY6NS2LoiThIS+5BJjJb1kFkYwCxhJdU5A=
X-Google-Smtp-Source: AGRyM1vVhXXGNXURwHJ+kWGvhOqzHHqMsKLBxuydYVytngXLy1xa1kKv/2e3jYPOCHjcZogSN3jtBAD7hHNIwb3jKkU=
X-Received: by 2002:a17:90b:388e:b0:1ec:f6b6:f31f with SMTP id
 mu14-20020a17090b388e00b001ecf6b6f31fmr4287488pjb.181.1656080932999; Fri, 24
 Jun 2022 07:28:52 -0700 (PDT)
MIME-Version: 1.0
References: <m2y1xsf34d.fsf@HIDDEN> <834k0ckdet.fsf@HIDDEN>
 <CAHyO48zHhO7uPHq2BBX7UnM_rXW-OBBN=pj=f6aTwx7Xi49dcg@HIDDEN>
 <0807c810-af05-f92c-17ce-991056906629@HIDDEN>
 <CAHyO48wccMewa6Am42mpJ+0q=wBkoGC_hSG+JOnk33n+qG3keA@HIDDEN>
 <62155072-ac5f-2a3d-b1dd-0c9363c74975@HIDDEN>
In-Reply-To: <62155072-ac5f-2a3d-b1dd-0c9363c74975@HIDDEN>
From: Aaron Jensen <aaronjensen@HIDDEN>
Date: Fri, 24 Jun 2022 10:28:42 -0400
Message-ID: <CAHyO48xEnb4RkAsOkMRegb4rfjMpGgL=hLToS9Scxzizy3Z8CQ@HIDDEN>
Subject: Re: bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size
 calculation can be incorrect when only is set to vertically
To: martin rudalics <rudalics@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56102
Cc: Eli Zaretskii <eliz@HIDDEN>, 56102 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Fri, Jun 24, 2022 at 5:20 AM martin rudalics <rudalics@HIDDEN> wrote:
>
>  > That seems to work for me. I do wonder though if the the check for
>  > `only' should be first (i.e. if only is vertically, max-width is nil).
>  > Is there a reason that we should not ignore a specified max-width when
>  > only is set to vertically?
>
> The idea of 'fit-frame-to-buffer' was that an application should be able
> to call it (maybe implicitly via 'temp-buffer-resize-mode') and not care
> about where on the display the frame will be shown.  Hence, a major
> concern of its design was to constrain the frame to some specified area
> on the display, to avoid that parts of it move off screen.  That's why
> 'fit-frame-to-buffer-margins' and 'fit-frame-to-buffer-sizes' have been
> provided.
>
> Currently, we check for an explicit MAX-WIDTH first and then consult
> 'fit-frame-to-buffer-sizes' via SIZES as
>
>                      ((numberp max-width) (* max-width char-width))
>                      ((numberp (nth 2 sizes)) (* (nth 2 sizes) char-width))
>
> If we were to override MAX-WIDTH by setting ONLY to 'vertically', where
> and how would we check SIZES?

I'm definitely not familiar enough with the workings and the intended
use cases. My only thought about it was one of principle of least
surprise. If I say that I only want it to scale vertically, I would
expect no width changes to occur, which means I would expect that
max-width and anything else width related would not be relevant.
There's likely something I'm missing here, so please feel free to
disregard if this is necessary for some reason.

>  > I ask because in the package that I had
>  > this issue with I employed a work-around where I set the max-width to
>  > (frame-parameter frame 'width), which seems to work well enough, but
>  > probably not as good as your fix. We may not be able to remove that
>  > workaround for some time, so ignoring max-width if set would probably
>  > work better in our specific case.
>
> Are these issues really related?  If your workaround works, it should
> continue working regardless of whether we ignore MAX-WIDTH when ONLY is
> 'vertically' or not.  Or am I missing something?

My concern was this:

> Also, the sizes of frame and window decorations would hardly match.

Effectively, that there would be some subtle difference between using
(frame-parameter frame 'width) as MAX-WIDTH and passing nil to
window-text-pixel-size window.

If there's no difference to be concerned about then my workaround
should be fine with the code as it was in the patch.

Thanks,

Aaron




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.

Message received at 56102 <at> debbugs.gnu.org:


Received: (at 56102) by debbugs.gnu.org; 24 Jun 2022 09:20:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 24 05:20:47 2022
Received: from localhost ([127.0.0.1]:40861 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o4fUd-0004kT-4l
	for submit <at> debbugs.gnu.org; Fri, 24 Jun 2022 05:20:47 -0400
Received: from mout.gmx.net ([212.227.15.15]:51051)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1o4fUb-0004kF-8r
 for 56102 <at> debbugs.gnu.org; Fri, 24 Jun 2022 05:20:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1656062438;
 bh=+3hGeizDTLVDV/R5yBom3U4XxtYGJCCZJP6SahBo1PI=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=iaj14Rv9CdrI96e9ICwecuilrCVyQzyPKAfD/4t2erPMPQlUc2WeB5PJA6mJoUu97
 D1+JJEm4KbfbAhY0SjJrO3YyHO4iOY2KOLbfG8S5/Wm+XjqjjpjM7sprua1zwm5SYo
 53zC4nqXNIDi07E3sHfq5YquJy002KUIvu8xA8Vw=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.100] ([213.142.96.230]) by mail.gmx.net (mrgmx005
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M72oH-1o1ftB0eIZ-008eqn; Fri, 24
 Jun 2022 11:20:38 +0200
Message-ID: <62155072-ac5f-2a3d-b1dd-0c9363c74975@HIDDEN>
Date: Fri, 24 Jun 2022 11:20:36 +0200
MIME-Version: 1.0
Subject: Re: bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size
 calculation can be incorrect when only is set to vertically
Content-Language: en-US
To: Aaron Jensen <aaronjensen@HIDDEN>
References: <m2y1xsf34d.fsf@HIDDEN> <834k0ckdet.fsf@HIDDEN>
 <CAHyO48zHhO7uPHq2BBX7UnM_rXW-OBBN=pj=f6aTwx7Xi49dcg@HIDDEN>
 <0807c810-af05-f92c-17ce-991056906629@HIDDEN>
 <CAHyO48wccMewa6Am42mpJ+0q=wBkoGC_hSG+JOnk33n+qG3keA@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <CAHyO48wccMewa6Am42mpJ+0q=wBkoGC_hSG+JOnk33n+qG3keA@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:jvwJHsIeYhakyMfO5PksBpxjz/6r6dJcVtTeKfykaJ8JGVP+oW0
 mCyhU12Brj/5c9Pr+slGdKdGNRUMO/j0rdgtLIJwfAje57od5GEnq2Shw9t9c41F1hDoeHh
 ae0hsELW/pgK2VAeIA3/Yfofw3lX5lLnZ8cwssj+7MRZzfTb2U9qrXh2P0O+MSrVtyA50nZ
 8xbqnLEO8wfXFPAxoBr5Q==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:71KEeSknGLE=:n12YOrAb+ozAaQ4+W6aHum
 R2hXG/5lYhVOyCqOj1T3K5v1dTZeUqluvUs/YThf0BGvMPJEk2oNVS+1zrvaayVHUrRBBDNZb
 z/H6Ddk2sqlgn5zBOmxCz+BiPcOrkDYUPc5/wV6mO0v06V8t6MSNe0ED4GG3Y2oupLLmZ2pmV
 XxR5bo3rGCkw3ZELNcN3TdyDGiiP/+sQqdkzO2H4PJEHKDEUCU4/YHMQrTbL+BZa5diIr1VZd
 MxHTS9oeG8GWM1Ola1qoNVTvz5FgAqukRJ73G8Je4Obh7Q4Z3AqbxtiL5oJK82VluhnZ6tLYr
 WnD3TpObFmlUExEJuBFJqQVJgSP61sdq5Dd3V+4Cdkl837nrXNJ5nbpZfla9TxIGVyEHEcyMp
 gy5MaZhcQow60RbUZIMMlVXboHpqQv9RLTvyqQLGQ3UjXpIOFURyCEOa0FbkFueED8n1qUadV
 9FyoKIyLyfd2cvtLq+GPq+BSz66iP+u+aB1R72a5vi28hIqf6MuKoVFSNdXIdbmte1pqHX04a
 sdPRjT0wlaL6g700WOUEjNCE2irrgioaTAxY10wrsQVcMfFov2VjMW33Om4oNeNXYZYnZacpw
 ELLqQUyA3nJ0FnKGkyeTCp9soic1rXjOgXinhXYND41FawXO5rDJwra/qDkTx+j9d+lKCgTVj
 nh3ZWVHERUEsfx4yn5iOSiqR/iEglhDS8W27IG0MUgScLdrz4d1VT0RJg5rorHgL7zjqCDJLw
 QlkXWKGmfgOCiA3oJaFRCrXkj1umYgdJ0cxKMWZdvjheaTRkXYu9YQPP9T0lpdFxAoyUPLUwr
 DdDK/T12aHk4Sqe8jpJcik/jZWNm9w/Mb7n6/n1UfLyfBA1zczPTkoP31hNYLbQjKpbVVfpKA
 rpYbFsVEOZ15PpVQdYegyNbcEOE4n68MyrniTdEeCg5BQB+uiXGzp3b+6e9s0zFBD0CFGJ1Oc
 LH6AJkcrrA5OOQNW9z68sdKunttE7ZLYlfQBJYw4BBQylgFkfxapUooHHcqQJ4lJkZMDRySbg
 gfF6wNRD5QvYCrAyDWna4dASMIeh5bVC1P0z805l4pcZn96j4hSLCPgAkCc0m6w/1ICJle/vy
 zcWvrngbdt1XoH9pd36h3PH/zIg+tdHuFvaUVPqaQNLqmCuc3qLAvvk+g==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 56102
Cc: Eli Zaretskii <eliz@HIDDEN>, 56102 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

 > That seems to work for me. I do wonder though if the the check for
 > `only' should be first (i.e. if only is vertically, max-width is nil).
 > Is there a reason that we should not ignore a specified max-width when
 > only is set to vertically?

The idea of 'fit-frame-to-buffer' was that an application should be able
to call it (maybe implicitly via 'temp-buffer-resize-mode') and not care
about where on the display the frame will be shown.  Hence, a major
concern of its design was to constrain the frame to some specified area
on the display, to avoid that parts of it move off screen.  That's why
'fit-frame-to-buffer-margins' and 'fit-frame-to-buffer-sizes' have been
provided.

Currently, we check for an explicit MAX-WIDTH first and then consult
'fit-frame-to-buffer-sizes' via SIZES as

                     ((numberp max-width) (* max-width char-width))
                     ((numberp (nth 2 sizes)) (* (nth 2 sizes) char-width))

If we were to override MAX-WIDTH by setting ONLY to 'vertically', where
and how would we check SIZES?

 > I ask because in the package that I had
 > this issue with I employed a work-around where I set the max-width to
 > (frame-parameter frame 'width), which seems to work well enough, but
 > probably not as good as your fix. We may not be able to remove that
 > workaround for some time, so ignoring max-width if set would probably
 > work better in our specific case.

Are these issues really related?  If your workaround works, it should
continue working regardless of whether we ignore MAX-WIDTH when ONLY is
'vertically' or not.  Or am I missing something?

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.

Message received at 56102 <at> debbugs.gnu.org:


Received: (at 56102) by debbugs.gnu.org; 24 Jun 2022 02:29:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 23 22:29:15 2022
Received: from localhost ([127.0.0.1]:40417 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o4Z4N-0006g0-KZ
	for submit <at> debbugs.gnu.org; Thu, 23 Jun 2022 22:29:15 -0400
Received: from mail-pl1-f175.google.com ([209.85.214.175]:38740)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <aaronjensen@HIDDEN>) id 1o4Z4L-0006fn-F3
 for 56102 <at> debbugs.gnu.org; Thu, 23 Jun 2022 22:29:13 -0400
Received: by mail-pl1-f175.google.com with SMTP id m14so884597plg.5
 for <56102 <at> debbugs.gnu.org>; Thu, 23 Jun 2022 19:29:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=QS25o5EQl3Hbtw3AFWCU2qxB/4w8GdX4RKq5ThCbfh0=;
 b=Ib1NgKcg9cRU7S7Ex6ZaANNyyuiSAj2NzZBZQKTXmuZyo3irswRh9+QCxh6cnk6NAj
 3l90Fjq42FjjMg0tZtRXwqRJbV0pvRJ/NHSpB15yWDut2Gc8SEzMYduMto6sEeKhEHog
 Pgf8zMyicssOeZu6LBILQ9zaTP1Y6nAnUzNHhiSu5twaeVO790ZUoJ11duN3GrYvXSYP
 rIo7EmVrZsZsLSx0vPSo9DP3UpfBARd1tSUMRQa8woVdnGKetLQH4/ZXPtPo0AmVaWbx
 0AixaIt8lekyTiqL30O7jDtbJDSlgNEvKe3doxFlgSdfxv/Jnt6SY+7PJQU0p8EYUbQ8
 /tHA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=QS25o5EQl3Hbtw3AFWCU2qxB/4w8GdX4RKq5ThCbfh0=;
 b=vOe+X3H10CbLeUAoSXldm0+FILeqH/UfOFKd88Vbh2wrboqPOR6qYEHS0U2vU28l94
 Wdk19VwRCAzp3aExnU9mFDUFqFL9rCdYek8SHI51Fstj57zlEEr6r4tH1RG8gic9H2CD
 8o1wbvycyweTQXCi1WHIAAUKmGAhy00nL32jSwBLMcZgxRjfdUfMkKsQAuKsR8MAMX2+
 fgFN+mwKCj7SpNWv8t08/we+bwYaHjQRBcuFEv/+7kk9LCBbMg9r8F1kGI8G5nx3RDK/
 tuEj/c7f8c3F6vbR253oJhH2pHoE7lfzRp9oIAB/gWpsBMdZprcUkQgzs7R2tTYjhImQ
 faGg==
X-Gm-Message-State: AJIora8F7zezdyB9GmVA3IyY8p/Xce/lnqoQ3n0x2dt6QAuh6uncH9Pj
 wHWtz8HSD02u6a8sgTN5dmxQ4QRYXlMQr05R7sI=
X-Google-Smtp-Source: AGRyM1sdOAfrxfYmG0sAE1FNYHptb5QcvvmMcyoqZqk72DyXb5kIguljNFfLrzSVH1ulsSemzou3nbz0fsnfM264690=
X-Received: by 2002:a17:902:900c:b0:16a:4521:10fd with SMTP id
 a12-20020a170902900c00b0016a452110fdmr12348382plp.75.1656037747445; Thu, 23
 Jun 2022 19:29:07 -0700 (PDT)
MIME-Version: 1.0
References: <m2y1xsf34d.fsf@HIDDEN> <834k0ckdet.fsf@HIDDEN>
 <CAHyO48zHhO7uPHq2BBX7UnM_rXW-OBBN=pj=f6aTwx7Xi49dcg@HIDDEN>
 <0807c810-af05-f92c-17ce-991056906629@HIDDEN>
In-Reply-To: <0807c810-af05-f92c-17ce-991056906629@HIDDEN>
From: Aaron Jensen <aaronjensen@HIDDEN>
Date: Thu, 23 Jun 2022 22:28:56 -0400
Message-ID: <CAHyO48wccMewa6Am42mpJ+0q=wBkoGC_hSG+JOnk33n+qG3keA@HIDDEN>
Subject: Re: bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size
 calculation can be incorrect when only is set to vertically
To: martin rudalics <rudalics@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56102
Cc: Eli Zaretskii <eliz@HIDDEN>, 56102 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Thu, Jun 23, 2022 at 3:30 AM martin rudalics <rudalics@HIDDEN> wrote:
>
>  >>> The problem appears to be the lines:
>  >>>
>  >>> (size
>  >>>              (window-text-pixel-size window from to max-width max-height))
>  >>>
>  >>> As the max-width will be larger than the current frame (meaning the
>  >>> height calculation will not take wrapping into account).
>
> I think MAX-WIDTH should be nil here.

Ah, I had no idea X-LIMIT could be nil, that's great.

> Please try the attached diff.

That seems to work for me. I do wonder though if the the check for
`only' should be first (i.e. if only is vertically, max-width is nil).
Is there a reason that we should not ignore a specified max-width when
only is set to vertically? I ask because in the package that I had
this issue with I employed a work-around where I set the max-width to
(frame-parameter frame 'width), which seems to work well enough, but
probably not as good as your fix. We may not be able to remove that
workaround for some time, so ignoring max-width if set would probably
work better in our specific case.

Thanks,

Aaron




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.

Message received at 56102 <at> debbugs.gnu.org:


Received: (at 56102) by debbugs.gnu.org; 23 Jun 2022 07:30:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 23 03:30:39 2022
Received: from localhost ([127.0.0.1]:37130 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o4HIU-0005WM-VF
	for submit <at> debbugs.gnu.org; Thu, 23 Jun 2022 03:30:39 -0400
Received: from mout.gmx.net ([212.227.17.20]:33305)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1o4HIR-0005W5-DT
 for 56102 <at> debbugs.gnu.org; Thu, 23 Jun 2022 03:30:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1655969428;
 bh=zgIA5Le6ytrnUOgMB9ILT/tYtzZPg8ox/jzxGQ4x8K8=;
 h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To;
 b=OR1jIqFIWUuyYlW3H6qOguGKiRfSipJBC1AxV6xOqFAiyw0AorYMF5aO0FhJRp3kE
 iYGLeElEE0hBMf7mj1kND2oJDEWUl+A2X42r1QxPK5+5eJkkWvp9JtW0KHGsyhDQ5o
 3s+0yatfzwRVJ1jrAtt4shQC5hPBRHL86RFGVFaE=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from [192.168.1.101] ([46.125.249.16]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mzyuc-1nhuaI0Q1m-00x2ll; Thu, 23
 Jun 2022 09:30:28 +0200
Content-Type: multipart/mixed; boundary="------------iY0tfU4h4cbkLiLpZgYAUF9z"
Message-ID: <0807c810-af05-f92c-17ce-991056906629@HIDDEN>
Date: Thu, 23 Jun 2022 09:30:26 +0200
MIME-Version: 1.0
Subject: Re: bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size
 calculation can be incorrect when only is set to vertically
Content-Language: en-US
To: Aaron Jensen <aaronjensen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <m2y1xsf34d.fsf@HIDDEN> <834k0ckdet.fsf@HIDDEN>
 <CAHyO48zHhO7uPHq2BBX7UnM_rXW-OBBN=pj=f6aTwx7Xi49dcg@HIDDEN>
From: martin rudalics <rudalics@HIDDEN>
In-Reply-To: <CAHyO48zHhO7uPHq2BBX7U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cFzEpe4IN73y0+Xn4gFwwpfpnva0iqzt6BmYVPMZb
 KqGgibtToZle8dYthsyYf1fvr0yYBCM3slcYitKo4reEFi68NXg9EI/dx7hVa4OFrGPW3rWRa
 wAUkZdZZhAy6RZJlqgzUMyaN2IBAwA6WcSzvUIIA3dVuMpyUuvepcY1C3HEpeOSbSP1N7ODVI
 RM5LPjQy7t0QRXVafIOY/mYjaXoIWilfo8NShT3dnptbH919Nmm4I+eePUMVjjR/zAZieIOc4
 o+x9xcQy8kCatf2qxYyb7F++I4UqdFA1UgwYHGnycKZ1lWXWJX9GmXvJqS9PoF/IZ8qOVUgdA
 /Q+PrIOtnsPOhdXbzLkQ2tj3HibRjgSAa1xebmx8+uEUPpzO+0UEC1auKnwuffVGfYOCSXaIX
 fDCMnfKcSVxiI2IlvdPqV4gfSEtnQOLjnWMr7FcO1kme2x6Wssv2UCfwQ==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 56102
Cc: 56102 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

This is a multi-part message in MIME format.
--------------iY0tfU4h4cbkLiLpZgYAUF9z
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

 >>> The problem appears to be the lines:
 >>>
 >>> (size
 >>>              (window-text-pixel-size window from to max-width max-height))
 >>>
 >>> As the max-width will be larger than the current frame (meaning the
 >>> height calculation will not take wrapping into account).

I think MAX-WIDTH should be nil here.

 >>> One possible fix is to set min/max height/width based on `only' to
 >>> (frame-parameter frame 'width) / (frame-parameter frame 'height) but I
 >>> do not know if that is the best fix.

This would not work.  The 'height' frame parameter counts in characters
while 'window-text-pixel-size' wants pixels as X-LIMIT.  Also, the sizes
of frame and window decorations would hardly match.

 >>> If that is done, then it may be possible to remove the rest of the
 >>> special handling for `only' that sets width/height to nil and handles that.
 >>
 >> I think you're right, but I'd like to hear if Martin has any comments.
 >
 > Sounds good. The most minimal change I can think of is to use the
 > current frame's width as max-width in the window-text-pixel-size call
 > when only is set to vertically. I don't know of any reason we need to
 > constrain max-height in that call because it doesn't have the same
 > impact. That can be done either explicitly in that call or by changing
 > max-width to be set to the current width as I described before. That
 > would be asymmetrical with max-height though, which would be rather
 > confusing IMO.

Please try the attached diff.

Thanks, martin
--------------iY0tfU4h4cbkLiLpZgYAUF9z
Content-Type: text/x-patch; charset=UTF-8; name="fit-frame-to-buffer.diff"
Content-Disposition: attachment; filename="fit-frame-to-buffer.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL2xpc3Avd2luZG93LmVsIGIvbGlzcC93aW5kb3cuZWwKaW5kZXggMWI4
ZmUyYjI2Mi4uN2I4Y2E4N2Y2YSAxMDA2NDQKLS0tIGEvbGlzcC93aW5kb3cuZWwKKysrIGIv
bGlzcC93aW5kb3cuZWwKQEAgLTkzODIsMTQgKzkzODIsMTcgQEAgZml0LWZyYW1lLXRvLWJ1
ZmZlci0xCiAgICAgICAgICAgICAgKChudW1iZXJwIChudGggMSBzaXplcykpICgqIChudGgg
MSBzaXplcykgbGluZS1oZWlnaHQpKQogICAgICAgICAgICAgICh0ICh3aW5kb3ctbWluLXNp
emUgd2luZG93IG5pbCBuaWwgdCkpKSkKICAgICAgICAgICAgKG1heC13aWR0aAotICAgICAg
ICAgICAgKG1pbgotICAgICAgICAgICAgIChjb25kCi0gICAgICAgICAgICAgICgobnVtYmVy
cCBtYXgtd2lkdGgpICgqIG1heC13aWR0aCBjaGFyLXdpZHRoKSkKLSAgICAgICAgICAgICAg
KChudW1iZXJwIChudGggMiBzaXplcykpICgqIChudGggMiBzaXplcykgY2hhci13aWR0aCkp
Ci0gICAgICAgICAgICAgICh0IHBhcmVudC1vci1kaXNwbGF5LXdpZHRoKSkKLSAgICAgICAg
ICAgICA7OyBUaGUgZm9sbG93aW5nIGlzIHRoZSBtYXhpbXVtIHdpZHRoIHRoYXQgZml0cyBp
bnRvIHRoZQotICAgICAgICAgICAgIDs7IGxlZnQgYW5kIHJpZ2h0IG1hcmdpbnMuCi0gICAg
ICAgICAgICAgKG1heCAoLSByaWdodC1tYXJnaW4gbGVmdC1tYXJnaW4gb3V0ZXItbWludXMt
Ym9keS13aWR0aCkpKSkKKyAgICAgICAgICAgIChsZXQgKChtYXgtd2lkdGgKKyAgICAgICAg
ICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICAgICAgICAoKG51bWJlcnAgbWF4LXdp
ZHRoKSAoKiBtYXgtd2lkdGggY2hhci13aWR0aCkpCisgICAgICAgICAgICAgICAgICAgICgo
bnVtYmVycCAobnRoIDIgc2l6ZXMpKSAoKiAobnRoIDIgc2l6ZXMpIGNoYXItd2lkdGgpKQor
ICAgICAgICAgICAgICAgICAgICAoKG5vdCAoZXEgb25seSAndmVydGljYWxseSkpIHBhcmVu
dC1vci1kaXNwbGF5LXdpZHRoKSkpKQorICAgICAgICAgICAgICAod2hlbiAobnVtYmVycCBt
YXgtd2lkdGgpCisgICAgICAgICAgICAgICAgKG1pbiBtYXgtd2lkdGgKKyAgICAgICAgICAg
ICAgICAgICAgIDs7IFRoZSBmb2xsb3dpbmcgaXMgdGhlIG1heGltdW0gd2lkdGggdGhhdCBm
aXRzCisgICAgICAgICAgICAgICAgICAgICA7OyBpbnRvIHRoZSBsZWZ0IGFuZCByaWdodCBt
YXJnaW5zLgorICAgICAgICAgICAgICAgICAgICAgKG1heCAoLSByaWdodC1tYXJnaW4gbGVm
dC1tYXJnaW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0ZXItbWludXMtYm9k
eS13aWR0aCkpKSkpKQogICAgICAgICAgICAobWluLXdpZHRoCiAgICAgICAgICAgICAoY29u
ZAogICAgICAgICAgICAgICgobnVtYmVycCBtaW4td2lkdGgpICgqIG1pbi13aWR0aCBjaGFy
LXdpZHRoKSkK

--------------iY0tfU4h4cbkLiLpZgYAUF9z--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.

Message received at 56102 <at> debbugs.gnu.org:


Received: (at 56102) by debbugs.gnu.org; 22 Jun 2022 14:15:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 22 10:15:45 2022
Received: from localhost ([127.0.0.1]:36207 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o418p-0002P8-KB
	for submit <at> debbugs.gnu.org; Wed, 22 Jun 2022 10:15:45 -0400
Received: from mail-pf1-f179.google.com ([209.85.210.179]:42700)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <aaronjensen@HIDDEN>) id 1o418o-0002Oi-9W
 for 56102 <at> debbugs.gnu.org; Wed, 22 Jun 2022 10:15:35 -0400
Received: by mail-pf1-f179.google.com with SMTP id d17so7272437pfq.9
 for <56102 <at> debbugs.gnu.org>; Wed, 22 Jun 2022 07:15:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=E9hwi/7DnfAGoguY24goonZtJId71srDkamcZoi6FSg=;
 b=GCcpuU1EajVOP4/K5FG61lz8gRsDzRM+KbRoFP3vpN68hh/Pdo6DH9e9z9fslDVIuU
 hq4kq99I423u72yKZGyVIZyTgcjwCcNxjZMi7uBKqYmtkE52xKAlwpEkoKg93C7BiZNq
 DF3z3iSIzpvKF7UI+/l8tGLDkIDAkQZ5/v4/LIkuxyc3Yri6Etosb6y5Qdw+633/8PNP
 XuWg04Ovh+kPjK74glqSWYD1fbOBrN7B7O/EqcMp2B5cEU9Vx0JLEztQQZfDfPbOd8iG
 7j6jKCIEKm8LKlAxThjnhuJQVHjpXNXLfrW/guAYojOQX/a/yFCYZiIud3C+Eun6TQFP
 Jlfw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=E9hwi/7DnfAGoguY24goonZtJId71srDkamcZoi6FSg=;
 b=KFjleNmKuN444BZL53bjQMaDNEW4tsuiOSD8aA7e2aqywrKun5paG/w6mm3zTanoiL
 rfQY4aQoUuKSrwd+GGA8vWbteTDKy8kkGNWaAgCIqHIbh0Cdn4q1BvqQTXht0Ohm5qJB
 shxxzKxT1xq705OTM113lXvFDxPTS+iWdkXEdxLak3RR7en3nwTbNphpcDckaBBW0IhY
 GR+wyeV7UCP4FUSy/9Z8V0K4PF8LP1rCj3KWq0Q3L2ZA4nNnyUdtwOisAZlFXCdOxwA8
 BibH9jWa1nLUw5Mz5GU99COrELCuxSc7tM26nTJYVF3m2aRsI4A+3AOdC7438pQH6L40
 i5mg==
X-Gm-Message-State: AJIora/dUWnxh4EopivQFr/JDD/jVqtf1OR712odgGiswnOUnsN53cvy
 28dEXFS3Wuc4xZ063SsUcIAv8g3C48RjtMNHnHE=
X-Google-Smtp-Source: AGRyM1uNpGHR4DOwubmbombcospu/iTRCU44+FxdKppZPz8X8c38b1ZVfUJ22qk/muJATjs8tMKm5xHSIOyBt90XhYI=
X-Received: by 2002:a63:5906:0:b0:401:9ade:d138 with SMTP id
 n6-20020a635906000000b004019aded138mr3109552pgb.520.1655907328456; Wed, 22
 Jun 2022 07:15:28 -0700 (PDT)
MIME-Version: 1.0
References: <m2y1xsf34d.fsf@HIDDEN> <834k0ckdet.fsf@HIDDEN>
In-Reply-To: <834k0ckdet.fsf@HIDDEN>
From: Aaron Jensen <aaronjensen@HIDDEN>
Date: Wed, 22 Jun 2022 10:15:17 -0400
Message-ID: <CAHyO48zHhO7uPHq2BBX7UnM_rXW-OBBN=pj=f6aTwx7Xi49dcg@HIDDEN>
Subject: Re: bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size
 calculation can be incorrect when only is set to vertically
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 56102
Cc: martin rudalics <rudalics@HIDDEN>, 56102 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Wed, Jun 22, 2022 at 9:59 AM Eli Zaretskii <eliz@HIDDEN> wrote:
>
> > From: Aaron Jensen <aaronjensen@HIDDEN>
> > Date: Sun, 19 Jun 2022 23:03:14 -0400
> >
> >
> > To repro, open emacs -Q and resize your frame so that the ";; This
> > buffer..." text wraps (this repro assumes your monitor has more than
> > enough space for it to not wrap if the frame was big enough).
> >
> > Add a few more lines of text and then:
> >
> > M-: (fit-frame-to-buffer nil nil nil nil nil 'vertically)
> >
> > You should see that the frame's height is too short and does not contain
> > all the lines. It contains one fewer line for each wrapped line.
> >
> > Screenshots:
> >
> > https://share.cleanshot.com/huexHe
> > https://share.cleanshot.com/dnhKex
> >
> > The problem appears to be the lines:
> >
> > (size
> >             (window-text-pixel-size window from to max-width max-height))
> >
> > As the max-width will be larger than the current frame (meaning the
> > height calculation will not take wrapping into account).
> >
> > One possible fix is to set min/max height/width based on `only' to
> > (frame-parameter frame 'width) / (frame-parameter frame 'height) but I
> > do not know if that is the best fix.
> >
> > If that is done, then it may be possible to remove the rest of the
> > special handling for `only' that sets width/height to nil and handles that.
>
> I think you're right, but I'd like to hear if Martin has any comments.

Sounds good. The most minimal change I can think of is to use the
current frame's width as max-width in the window-text-pixel-size call
when only is set to vertically. I don't know of any reason we need to
constrain max-height in that call because it doesn't have the same
impact. That can be done either explicitly in that call or by changing
max-width to be set to the current width as I described before. That
would be asymmetrical with max-height though, which would be rather
confusing IMO.

Aaron




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.

Message received at 56102 <at> debbugs.gnu.org:


Received: (at 56102) by debbugs.gnu.org; 22 Jun 2022 13:59:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 22 09:59:07 2022
Received: from localhost ([127.0.0.1]:36184 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o40st-0001zD-He
	for submit <at> debbugs.gnu.org; Wed, 22 Jun 2022 09:59:07 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38856)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1o40sr-0001yK-35
 for 56102 <at> debbugs.gnu.org; Wed, 22 Jun 2022 09:59:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42276)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1o40sl-0000tH-J4; Wed, 22 Jun 2022 09:58:59 -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=4oarLxEm8dzXXM6QBk9h97OubfPUAXhKzrZyUKZDHR0=; b=rF3SxxUi+NJD
 sodjtjjvMOOtqaqrOCp3edRtAWQPjZMY/LGUepK6de0En8O+6voJEQYCnLtxg4GxMCtVoDhRaZ+A8
 iWwNK2FZYzvYCCeY2cMSkQvqO0EcNpQi7wmIEZbWK+Am/XJgPXQm99Z9PqqkxfTGvsJm/7rPUI7nL
 Z986b0H0qIpKkVJO0Tkqu4KCrWKQuhsjwxCgkKjNjH9cC2a364wcK0Y6T+S2Qf2Y4L+KFAqfgFW6W
 tJtkcG0zlnmATwIyNkxnEbWJpeyw+qVJ5ICB5/wXumKMv7BLPXDO82z5rzkqkDszyTlnl0/CxTN5x
 gm98sPSHhF/T616BLkQVIg==;
Received: from [87.69.77.57] (port=3861 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1o40sl-0000wB-1h; Wed, 22 Jun 2022 09:58:59 -0400
Date: Wed, 22 Jun 2022 16:58:50 +0300
Message-Id: <834k0ckdet.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Aaron Jensen <aaronjensen@HIDDEN>, martin rudalics <rudalics@HIDDEN>
In-Reply-To: <m2y1xsf34d.fsf@HIDDEN> (message from Aaron Jensen on Sun, 19
 Jun 2022 23:03:14 -0400)
Subject: Re: bug#56102: 29.0.50;
 fit-frame-to-buffer's window-text-pixel-size calculation can be
 incorrect when only is set to vertically
References: <m2y1xsf34d.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 56102
Cc: 56102 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Aaron Jensen <aaronjensen@HIDDEN>
> Date: Sun, 19 Jun 2022 23:03:14 -0400
> 
> 
> To repro, open emacs -Q and resize your frame so that the ";; This
> buffer..." text wraps (this repro assumes your monitor has more than
> enough space for it to not wrap if the frame was big enough).
> 
> Add a few more lines of text and then:
> 
> M-: (fit-frame-to-buffer nil nil nil nil nil 'vertically)
> 
> You should see that the frame's height is too short and does not contain
> all the lines. It contains one fewer line for each wrapped line.
> 
> Screenshots:
> 
> https://share.cleanshot.com/huexHe
> https://share.cleanshot.com/dnhKex
> 
> The problem appears to be the lines:
> 
> (size
>             (window-text-pixel-size window from to max-width max-height))
> 
> As the max-width will be larger than the current frame (meaning the
> height calculation will not take wrapping into account).
> 
> One possible fix is to set min/max height/width based on `only' to
> (frame-parameter frame 'width) / (frame-parameter frame 'height) but I
> do not know if that is the best fix.
> 
> If that is done, then it may be possible to remove the rest of the
> special handling for `only' that sets width/height to nil and handles that.

I think you're right, but I'd like to hear if Martin has any comments.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 Jun 2022 03:03:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 19 23:03:24 2022
Received: from localhost ([127.0.0.1]:53636 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o37hE-0004b7-FS
	for submit <at> debbugs.gnu.org; Sun, 19 Jun 2022 23:03:24 -0400
Received: from lists.gnu.org ([209.51.188.17]:36500)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <aaronjensen@HIDDEN>) id 1o37hA-0004aw-Jw
 for submit <at> debbugs.gnu.org; Sun, 19 Jun 2022 23:03:23 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:39590)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <aaronjensen@HIDDEN>)
 id 1o37hA-00062o-ED
 for bug-gnu-emacs@HIDDEN; Sun, 19 Jun 2022 23:03:20 -0400
Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]:38714)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <aaronjensen@HIDDEN>)
 id 1o37h8-0004t2-9T
 for bug-gnu-emacs@HIDDEN; Sun, 19 Jun 2022 23:03:19 -0400
Received: by mail-qv1-xf34.google.com with SMTP id p31so14268786qvp.5
 for <bug-gnu-emacs@HIDDEN>; Sun, 19 Jun 2022 20:03:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:subject:date:message-id:mime-version;
 bh=WzWEuMMtqgx8g3iSioCmxe6wRibq9AWKcn+6fq9iPHo=;
 b=HoEo5ag283KIZdnNRf9eM3UuSac6FRMLydNBKkYj7D/7YsGbVp9bnFDqNrlomzEsLq
 fuDOrGnkbcOJoG/k4gsqcDE//xyjRMkdIkzyUQAM1SVu1DLKBR6WPX8s/KGhYKJ84vNw
 rHo08LE9SFONg4Ud+ZCtEt3Z37jKC2xYYSluRJTBL5ZymdjCR6FZGsc58sSVezNxDejK
 ApJr9qrQ7SK4+2VrFKmtjZISHXzEJzxmDmxttiwoYQzTTAt9r/gXmL95a0LKui4XJOH0
 HLgL32xhiyBe9NjO8EKB0xczfq/xciv6JXCT+vJhrq73ahScZ/G1/nLReAePs5yOEriP
 YP5g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version;
 bh=WzWEuMMtqgx8g3iSioCmxe6wRibq9AWKcn+6fq9iPHo=;
 b=EsR9loEzawcL/HBGATzx8g0nIq/d4/N7JuS01Uf/5yrQcPcqU/xGaFdc2iH7Mpzptc
 STJXaZtE7d+T81Ao0sTLYrjGB3Vpm9wRrr9HNGuOIMcwmRQFcpBBvqOTNtedOqoz83+t
 RPozv06Jv+d19k4zhl06q2PqICRlTSkwvm4EgeBQPCAhw/W7XzNKqkg3Hn5e1rDQNetS
 LfkTvHGYba/GAPENa5Gw7NTJz0LgwWfXJVDTB1FO+goFa86xNhQPy8IfnrJ6X/3cy+o+
 hRM5xG7gF8xtGf77SYVVM/0zRJ1NZuWwC41+XQCAzbelZHIq9tskDc4TCL8rw2WEBftw
 vsBQ==
X-Gm-Message-State: AJIora9CNxx1ENMJfui1aqbxV5XpeDwQ1a3SJQ/UyyZadA2RYk/6KXGL
 CEmzWt1evoFtRG7knvyHxXBnxOcFKog=
X-Google-Smtp-Source: AGRyM1snnbTCEKrS7F07GTrCw1GtamBBPpAJw5ixwnTiG2urvQf7dLnWeP/gCstj0oLvKajr8ZaFJQ==
X-Received: by 2002:ad4:5d49:0:b0:46a:66a2:d73f with SMTP id
 jk9-20020ad45d49000000b0046a66a2d73fmr17421408qvb.45.1655694196527; 
 Sun, 19 Jun 2022 20:03:16 -0700 (PDT)
Received: from aaron-m1.local ([71.215.162.245])
 by smtp.gmail.com with ESMTPSA id
 i3-20020a05620a248300b0069fc13ce23dsm11432880qkn.110.2022.06.19.20.03.15
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 19 Jun 2022 20:03:15 -0700 (PDT)
From: Aaron Jensen <aaronjensen@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.50; fit-frame-to-buffer's window-text-pixel-size calculation
 can be incorrect when only is set to vertically
Date: Sun, 19 Jun 2022 23:03:14 -0400
Message-ID: <m2y1xsf34d.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2607:f8b0:4864:20::f34;
 envelope-from=aaronjensen@HIDDEN; helo=mail-qv1-xf34.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)


To repro, open emacs -Q and resize your frame so that the ";; This
buffer..." text wraps (this repro assumes your monitor has more than
enough space for it to not wrap if the frame was big enough).

Add a few more lines of text and then:

M-: (fit-frame-to-buffer nil nil nil nil nil 'vertically)

You should see that the frame's height is too short and does not contain
all the lines. It contains one fewer line for each wrapped line.

Screenshots:

https://share.cleanshot.com/huexHe
https://share.cleanshot.com/dnhKex

The problem appears to be the lines:

(size
            (window-text-pixel-size window from to max-width max-height))

As the max-width will be larger than the current frame (meaning the
height calculation will not take wrapping into account).

One possible fix is to set min/max height/width based on `only' to
(frame-parameter frame 'width) / (frame-parameter frame 'height) but I
do not know if that is the best fix.

If that is done, then it may be possible to remove the rest of the
special handling for `only' that sets width/height to nil and handles that.

In GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.5.0, NS appkit-2113.50 Version 12.4 (Build 21F79))
 of 2022-05-30 built on aaron-m1.local
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.4





Acknowledgement sent to Aaron Jensen <aaronjensen@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#56102; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 28 Jun 2022 21:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.