bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size calcula


From: Aaron Jensen
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

On Thu, Jun 23, 2022 at 3:30 AM martin rudalics <rudalics@gmx.at> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]