From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics 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: Fri, 24 Jun 2022 11:20:36 +0200 Message-ID: <62155072-ac5f-2a3d-b1dd-0c9363c74975@gmx.at> References: <834k0ckdet.fsf@gnu.org> <0807c810-af05-f92c-17ce-991056906629@gmx.at> 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="10657"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 56102@debbugs.gnu.org To: Aaron Jensen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 24 11:24:34 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 1o4fYF-0002Y7-Pe for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Jun 2022 11:24:31 +0200 Original-Received: from localhost ([::1]:59732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4fYE-00061d-1W for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Jun 2022 05:24:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4fUs-0000aT-Hx for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2022 05:21:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4fUs-0005K2-8a for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2022 05:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o4fUs-0004lG-4Q for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2022 05:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Jun 2022 09:21:02 +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.165606244718261 (code B ref 56102); Fri, 24 Jun 2022 09:21:02 +0000 Original-Received: (at 56102) by debbugs.gnu.org; 24 Jun 2022 09:20:47 +0000 Original-Received: from localhost ([127.0.0.1]:40861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4fUd-0004kT-4l for submit@debbugs.gnu.org; Fri, 24 Jun 2022 05:20:47 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:51051) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4fUb-0004kF-8r for 56102@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 Original-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 Content-Language: en-US In-Reply-To: X-Provags-ID: V03:K1:jvwJHsIeYhakyMfO5PksBpxjz/6r6dJcVtTeKfykaJ8JGVP+oW0 mCyhU12Brj/5c9Pr+slGdKdGNRUMO/j0rdgtLIJwfAje57od5GEnq2Shw9t9c41F1hDoeHh ae0hsELW/pgK2VAeIA3/Yfofw3lX5lLnZ8cwssj+7MRZzfTb2U9qrXh2P0O+MSrVtyA50nZ 8xbqnLEO8wfXFPAxoBr5Q== 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 QlkXWKGmfgOCiA3oJaFRCrXkj1umYgdJ0cxKMWZdvjheaTRkXYu9YQPP9T0lpdFxAoyUPLUw 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:235158 Archived-At: > 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