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: Sun, 26 Jun 2022 09:12:31 -0400

On Sun, Jun 26, 2022 at 6:09 AM martin rudalics <rudalics@gmx.at> wrote:
> But actually it is the _body_ size of FRAME's root window the current
> code constrains.  Incidentally, the default body width of a live root
> window equals the value of FRAME's width parameter (the native width of
> the frame minus the widths of the internal border, the scroll bar and
> the fringes) which makes your fix work.  With a non-standard setup, say
> after doing
>
> (set-window-margins nil 10 10)
>
> in the root window, your fix will fail with the scenario you provided
> earlier.

Ah, I can confirm this. Is there a reasonable way for me to calculate
a max-width that would be based on the root window that would work?
There's other math that happens within fit-frame-to-buffer I don't
fully have my head wrapped around yet. I'm not super worried about
this personally as I don't set window margins on this window.


> We could try the following: If the new diff I attach now works for you,
> I'll push it to master.  If after some period of grace (whose length you
> determine) I manage to come up with a reasonable fix, I'll push that to
> master too and you and your clients will have to adapt.  WDYT?

The patch works for me and seems good. When you say if you come up
with a reasonable fix, could I ask what is unreasonable about the
patch you attached?

Regardless, if you do end up updating the fix to respect a supplied
max-width even if only vertically is supplied, I could always make an
Emacs version based decision on whether or not to pass the work-around
max-width in, and Emacs 29 is as good a version as any to stop passing
it in (people already on master will have to recompile, but that's
fine imo). So, I would be fine with the new patch going straight to
master, though as I mentioned I don't know what it would do
differently or why.

Thanks,

Aaron





reply via email to

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