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: Thu, 23 Jun 2022 22:28:56 -0400 Message-ID: References: <834k0ckdet.fsf@gnu.org> <0807c810-af05-f92c-17ce-991056906629@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="24467"; 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 04:30:48 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 1o4Z5s-0006EB-LX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Jun 2022 04:30:48 +0200 Original-Received: from localhost ([::1]:40434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4Z5r-0004Q6-Iq for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Jun 2022 22:30:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4Z58-0004Pm-Sh for bug-gnu-emacs@gnu.org; Thu, 23 Jun 2022 22:30:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46520) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4Z58-0000Xv-JG for bug-gnu-emacs@gnu.org; Thu, 23 Jun 2022 22:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o4Z58-0006hK-Cy for bug-gnu-emacs@gnu.org; Thu, 23 Jun 2022 22:30: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 02:30: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.165603775525672 (code B ref 56102); Fri, 24 Jun 2022 02:30:02 +0000 Original-Received: (at 56102) by debbugs.gnu.org; 24 Jun 2022 02:29:15 +0000 Original-Received: from localhost ([127.0.0.1]:40417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4Z4N-0006g0-KZ for submit@debbugs.gnu.org; Thu, 23 Jun 2022 22:29:15 -0400 Original-Received: from mail-pl1-f175.google.com ([209.85.214.175]:38740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4Z4L-0006fn-F3 for 56102@debbugs.gnu.org; Thu, 23 Jun 2022 22:29:13 -0400 Original-Received: by mail-pl1-f175.google.com with SMTP id m14so884597plg.5 for <56102@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) In-Reply-To: <0807c810-af05-f92c-17ce-991056906629@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:235144 Archived-At: On Thu, Jun 23, 2022 at 3:30 AM martin rudalics 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