Subject: Re: bug#19972: 24.4; Font size change doesn't update (window-total-width)

From: Eli Zaretskii <[email-masked]>
Date: Sun, 01 Mar 2015 17:28:49 +0200

> Date: Sun, 01 Mar 2015 16:14:38 +0100
> From: martin rudalics <[email-masked]>
> 
>  > ELISP> (face-spec-recalc 'default (selected-frame))
>  > nil
>  > ELISP> (window-total-width)
>  > 240 (#o360, #xf0, ?ð)
>  >
>  > ;; now press `C-x 3` followed by `C-x 1'
>  >
>  > ELISP> (window-total-width)
>  > 192 (#o300, #xc0, ?À)
>  > ELISP>
>  >
>  > The second call to `window-total-width` returns 240, but it should have
>  > returned 192.
> 
> I must admit that I don't have the faintest idea what `face-spec-recalc'
> is supposed to do.

For the purposes of this discussion, I think the only thing that
matters is that it applies the change in the default face's font.

> Anyway.  Why do you think that `window-total-width' should return 192 in
> the first call?  In principle, face/font changes are supposed to keep
> the number of columns/lines unchanged so returning 240 seems reasonable
> to me.

Indeed.  It does for me.  Could this be something specific to GTK or
the window manager?

Also, I don't understand why the initial value is 240 in the first
place.  By default, "emacs -Q" creates a 80-column window, so I'd
expect window-total-width to return a value slightly larger than 80 (I
get 84 here).

So it sounds like some additional factors are at work here.