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: Fri, 24 Jun 2022 10:28:42 -0400 Message-ID: References: <834k0ckdet.fsf@gnu.org> <0807c810-af05-f92c-17ce-991056906629@gmx.at> <62155072-ac5f-2a3d-b1dd-0c9363c74975@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="31561"; 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 Fri Jun 24 16:43:19 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 1o4kWi-0007yF-Ul for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Jun 2022 16:43:17 +0200 Original-Received: from localhost ([::1]:56112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4kWi-000636-20 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Jun 2022 10:43:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4kIw-0007bp-SM for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2022 10:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49222) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4kIw-0004HL-GB for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2022 10:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o4kIw-0001GU-CN for bug-gnu-emacs@gnu.org; Fri, 24 Jun 2022 10:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Jun 2022 14:29: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.16560809414855 (code B ref 56102); Fri, 24 Jun 2022 14:29:02 +0000 Original-Received: (at 56102) by debbugs.gnu.org; 24 Jun 2022 14:29:01 +0000 Original-Received: from localhost ([127.0.0.1]:43119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4kIv-0001GF-96 for submit@debbugs.gnu.org; Fri, 24 Jun 2022 10:29:01 -0400 Original-Received: from mail-pj1-f54.google.com ([209.85.216.54]:56044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4kIt-0001G0-1y for 56102@debbugs.gnu.org; Fri, 24 Jun 2022 10:29:00 -0400 Original-Received: by mail-pj1-f54.google.com with SMTP id w24so2928357pjg.5 for <56102@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) In-Reply-To: <62155072-ac5f-2a3d-b1dd-0c9363c74975@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:235188 Archived-At: On Fri, Jun 24, 2022 at 5:20 AM martin rudalics 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