unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Aaron Jensen <aaronjensen@gmail.com>, martin rudalics <rudalics@gmx.at>
Cc: 56102@debbugs.gnu.org
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: Wed, 22 Jun 2022 16:58:50 +0300	[thread overview]
Message-ID: <834k0ckdet.fsf@gnu.org> (raw)
In-Reply-To: <m2y1xsf34d.fsf@gmail.com> (message from Aaron Jensen on Sun, 19 Jun 2022 23:03:14 -0400)

> From: Aaron Jensen <aaronjensen@gmail.com>
> 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.





  reply	other threads:[~2022-06-22 13:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20  3:03 bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size calculation can be incorrect when only is set to vertically Aaron Jensen
2022-06-22 13:58 ` Eli Zaretskii [this message]
2022-06-22 14:15   ` Aaron Jensen
2022-06-23  7:30     ` martin rudalics
2022-06-24  2:28       ` Aaron Jensen
2022-06-24  9:20         ` martin rudalics
2022-06-24 14:28           ` Aaron Jensen
2022-06-26 10:09             ` martin rudalics
2022-06-26 13:12               ` Aaron Jensen
2022-06-27  8:24                 ` martin rudalics
2022-06-27 13:24                   ` Aaron Jensen
2022-06-28  9:29                     ` martin rudalics
2022-06-28 14:52                       ` Aaron Jensen
2022-07-05 13:07                         ` Aaron Jensen
2022-07-06  7:37                           ` martin rudalics
2022-07-06 13:17                             ` Aaron Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=834k0ckdet.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=56102@debbugs.gnu.org \
    --cc=aaronjensen@gmail.com \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).