GNU bug report logs -
#37563
27.0.50; fit-frame-to-buffer does not account for line-spacing
Previous Next
Reported by: Ingo Lohmar <ingo.lohmar <at> posteo.net>
Date: Mon, 30 Sep 2019 19:34:01 UTC
Severity: normal
Found in version 27.0.50
Done: Ingo Lohmar <ingo.lohmar <at> posteo.net>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 37563 <at> debbugs.gnu.org (full text, mbox):
On Tue, Oct 01 2019 10:10 (+0200), martin rudalics wrote:
> > thanks for the quick reply! The fix is working for me. The separate
> > window-*-height functions are much better than what I sent a few
> > minutes ago, I missed all kinds of scenarios, of course.
>
> For consistency, I would use these functions in 'fit-window-to-buffer'
> as well. But I haven't looked into all consequences yet. There's
> also Bug#14825 still sitting around the corner, awaiting a proper
> solution. It's somehow troubling that all these substitute canonical
> character height with real line height fixes are inherently backward
> incompatible. What if someone did mean to use the canonical character
> height there?
I surely find the complexity of all this code jarring, so I have to
restrict myself to looking at a single issue; and here, it's clearly
fixing a bug, using the char height is simply wrong, IMO.
>
> > There's one thing from my patch, however, that I think is missing in
> > yours:
>
> I think you're right but I need to see your patch first. It's not
> here yet.
Debbugs and the mailing list interaction is another thing I do not
really understand ;) In any case, the patch would simply be confusing
now, here's the change on top of yours:
@@ -8794,8 +8828,8 @@ fit-frame-to-buffer
;; Fit height to constraints.
(when height
(unless frame-resize-pixelwise
- (setq height (* (/ (+ height char-height -1) char-height)
- char-height)))
+ (setq height (* (/ (+ height line-height -1) line-height)
+ line-height)))
;; The new outer height.
(setq outer-height (+ height outer-minus-body-height))
;; Preserve margins.
And then char-height can be dropped.
Best,
Ingo
This bug report was last modified 5 years and 219 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.