From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs Subject: bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size calculation can be incorrect when only is set to vertically Date: Sun, 26 Jun 2022 09:12:31 -0400 Message-ID: References: <834k0ckdet.fsf@gnu.org> <0807c810-af05-f92c-17ce-991056906629@gmx.at> <62155072-ac5f-2a3d-b1dd-0c9363c74975@gmx.at> <1a6138f1-fae9-4d33-28b4-7069028ccc36@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40031"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 56102@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 26 15:13:21 2022 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 1o5S4n-000ADF-Pf for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Jun 2022 15:13:21 +0200 Original-Received: from localhost ([::1]:54486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5S4m-0002Ck-Lm for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Jun 2022 09:13:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5S4U-0002Cb-9r for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2022 09:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53042) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5S4U-0000fe-0C for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2022 09:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o5S4T-00035G-SA for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2022 09:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Jun 2022 13:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56102 X-GNU-PR-Package: emacs Original-Received: via spool by 56102-submit@debbugs.gnu.org id=B56102.165624917011834 (code B ref 56102); Sun, 26 Jun 2022 13:13:01 +0000 Original-Received: (at 56102) by debbugs.gnu.org; 26 Jun 2022 13:12:50 +0000 Original-Received: from localhost ([127.0.0.1]:46939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5S4I-00034m-AS for submit@debbugs.gnu.org; Sun, 26 Jun 2022 09:12:50 -0400 Original-Received: from mail-pg1-f171.google.com ([209.85.215.171]:41639) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5S4G-00034a-Ee for 56102@debbugs.gnu.org; Sun, 26 Jun 2022 09:12:49 -0400 Original-Received: by mail-pg1-f171.google.com with SMTP id 23so6670943pgc.8 for <56102@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) In-Reply-To: <1a6138f1-fae9-4d33-28b4-7069028ccc36@gmx.at> 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" Xref: news.gmane.io gmane.emacs.bugs:235327 Archived-At: On Sun, Jun 26, 2022 at 6:09 AM martin rudalics 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