GNU bug report logs - #19972
24.4; Font size change doesn't update (window-total-width)

Previous Next

Package: emacs;

Reported by: Joost Kremers <joostkremers <at> fastmail.fm>

Date: Sun, 1 Mar 2015 02:32:02 UTC

Severity: normal

Found in version 24.4

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


Message #83 received at 19972 <at> debbugs.gnu.org (full text, mbox):

From: Steve Purcell <steve <at> sanityinc.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 19972 <at> debbugs.gnu.org
Subject: Re: bug#19972: Font size change doesn't update (window-total-width)
Date: Mon, 2 Mar 2015 17:23:58 +0000
On 2 Mar 2015, at 17:10, martin rudalics <rudalics <at> gmx.at> wrote:
> 
> > - Consider the case of full-screen frames, which never change in pixel
> >   size. The window-width should change when the font size changes in
> >   this case too.
> 
> This is the case (hopefully) with Emacs 25 but not with Emacs 24.5.
> Although some window managers may refuse to change the frame size even
> with Emacs 24.5 as we've learned here.



It’s not the case on OS X with Emacs HEAD from 19th Feb, at least.



> > - set-frame-font is a built-in function with a KEEP-SIZE param which
> >   tells it to try to preserve the pixel-size of the frame after the
> >   font has changed: my code is copied from there.
> 
> If you look at the implementation of this you will see that it first
> resizes the frame (via x_new_font) and then tries to size it back to the
> original size.  This will fail miserably when the frame was maximized
> before (because maximization is a state and not just a specific size)
> and will fail when the frame size was not an integral multiple of its
> default character size (because `set-frame-font' does some strange
> rounding).  So never ever use `set-frame-font' with KEEP-SIZE non-nil.
> With Emacs 25 you can do, for example,
> 
> (let ((frame-inhibit-implied-resize t))
>  (custom-push-theme 'theme-face 'default 'user 'set '((t (:height 128))))
>  (face-spec-recalc 'default (selected-frame)))
> 
> unless you have set `frame-inhibit-implied-resize' to non-nil already.


Interesting: I hadn’t seen that. The above snippet still results in a changed frame size on my system, though.





This bug report was last modified 7 years and 285 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.