[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: |
martin rudalics |
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 09:30:26 +0200 |
>>> 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.
>>> 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.
This would not work. The 'height' frame parameter counts in characters
while 'window-text-pixel-size' wants pixels as X-LIMIT. Also, the sizes
of frame and window decorations would hardly match.
>>> 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.
>
> Sounds good. The most minimal change I can think of is to use the
> current frame's width as max-width in the window-text-pixel-size call
> when only is set to vertically. I don't know of any reason we need to
> constrain max-height in that call because it doesn't have the same
> impact. That can be done either explicitly in that call or by changing
> max-width to be set to the current width as I described before. That
> would be asymmetrical with max-height though, which would be rather
> confusing IMO.
Please try the attached diff.
Thanks, martin
fit-frame-to-buffer.diff
Description: Text Data
- 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/19
- bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size calculation can be incorrect when only is set to vertically, Eli Zaretskii, 2022/06/22
- 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
- bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size calculation can be incorrect when only is set to vertically,
martin rudalics <=
- 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/23
- bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size calculation can be incorrect when only is set to vertically, martin rudalics, 2022/06/24
- 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/24
- bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size calculation can be incorrect when only is set to vertically, martin rudalics, 2022/06/26
- 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/26
- bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size calculation can be incorrect when only is set to vertically, martin rudalics, 2022/06/27
- 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/27
- bug#56102: 29.0.50; fit-frame-to-buffer's window-text-pixel-size calculation can be incorrect when only is set to vertically, martin rudalics, 2022/06/28
- 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/28