GNU bug report logs -
#70894
[PATCH] * lisp/window.el (fit-window-to-buffer): Fix width calculation
Previous Next
Full log
View this message in rfc822 format
> Date: Sun, 19 May 2024 09:58:58 +0200
> Cc: 70894 <at> debbugs.gnu.org
> From: martin rudalics <rudalics <at> gmx.at>
>
> > Martin, any comments?
>
> Looks good to me. Principally, instead of subtracting the sizes of the
> decorations from the initial total width and re-adding them later, they
> should have been added to the calculated pixel width as is done when
> fitting the height.
OK, I installed the patch on master now, thanks.
> But mildly spoken, 'fit-window-to-buffer' is a complete mess in the
> first place. Calculating sizes in terms of lines/columns doesn't make
> sense. If really necessary - minibuffer resizing, for example, does not
> care - results should be rounded in a final step. Also, I doubt that
> both char-width and char-height are calculated reasonably when buffer
> text is scaled or line spacing changed.
For the last issue: we should use default-font-width/height. But the
question is: would replacing frame-char-width/height by these two fix
that use case, or do we need anything else?
This bug report was last modified 145 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.