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

From: Eli Zaretskii <[email-masked]>
Date: Mon, 02 Mar 2015 19:35:03 +0200

> Date: Mon, 02 Mar 2015 18:08:45 +0100
> From: martin rudalics <[email-masked]>
> CC: [email-masked]
> 
>  > Here's the backtrace from the code that resizes the frame as result of
>  > face-spec-recalc:
>  >
>  > 0x0109bc93 in resize_frame_windows (f=0x17d7a30 <dumped_data+2428016>,
>  >      size=833, horflag=true, pixelwise=true) at window.c:4192
>  > 4192            r->pixel_width = new_pixel_size;
>  > (gdb) bt
>  > #0  0x0109bc93 in resize_frame_windows (f=0x17d7a30 <dumped_data+2428016>,
>  >      size=833, horflag=true, pixelwise=true) at window.c:4192
> 
> Here you see resize_frame_windows getting called which will eventually
> call `window--pixel-to-total' to assign the new total sizes of windows.
> For Joost this call doesn't happen because new_windows_width equals
> old_windows_width.

I don't understand why that would happen.  It doesn't seem to happen
for me, with the current emacs-24 branch.

>  > #1  0x01011f3e in adjust_frame_size (f=0x17d7a30 <dumped_data+2428016>,
>  >      new_width=800, new_height=700, inhibit=5, pretend=false, parameter=8064)
>  >      at frame.c:524
>  > #2  0x0100f0cc in change_frame_size_1 (f=0x17d7a30 <dumped_data+2428016>,
>  >      new_width=800, new_height=700, pretend=false, delay=false, safe=false,
>  >      pixelwise=true) at dispnew.c:5501
>  > #3  0x0100f12a in change_frame_size (f=0x17d7a30 <dumped_data+2428016>,
>  >      new_width=800, new_height=700, pretend=false, delay=false, safe=false,
>  >      pixelwise=true) at dispnew.c:5533
>  > #4  0x0100eeb8 in do_pending_window_change (safe=false) at dispnew.c:5459
>  > #5  0x0123f29d in x_set_window_size (f=0x17d7a30 <dumped_data+2428016>,
>  >      change_gravity=false, width=800, height=700, pixelwise=true)
>  >      at w32term.c:6194
>  > #6  0x01011e7e in adjust_frame_size (f=0x17d7a30 <dumped_data+2428016>,
>  >      new_width=800, new_height=700, inhibit=3, pretend=false, parameter=14464)
>  >      at frame.c:490
> 
> Note that x_new_font _always_ calls adjust_frame_size (even for the
> `set-frame-font' KEEP-SIZE non-nil case) trying to adjust the frame
> size.
> 
> I sincerely hope your frame was not maximized here.  Otherwise,
> resize_frame_windows should not have been called ...

It is called with maximized frames as well, see the backtrace below.

#0  0x010913a4 in resize_frame_windows (f=0x3a7b5d0, size=2396, horflag=true,
    pixelwise=true) at window.c:4211
#1  0x0100ea3e in change_frame_size_1 (f=0x3a7b5d0, new_width=2360,
    new_height=1300, pretend=false, delay=false, safe=false, pixelwise=true)
    at dispnew.c:5610
#2  0x0100e719 in change_frame_size (f=0x3a7b5d0, new_width=2360,
    new_height=1300, pretend=false, delay=false, safe=false, pixelwise=true)
    at dispnew.c:5518
#3  0x0100e60c in do_pending_window_change (safe=false) at dispnew.c:5479
#4  0x010199eb in x_set_font (f=0x3a7b5d0, arg=62956977, oldval=58852321)
    at frame.c:3355
#5  0x01017c73 in x_set_frame_parameters (f=0x3a7b5d0, alist=58296354)
    at frame.c:2889
#6  0x01016c55 in Fmodify_frame_parameters (frame=61322709, alist=58675454)
    at frame.c:2350
#7  0x010e9f66 in set_font_frame_param (frame=61322709, lface=61590461)
    at xfaces.c:3418
#8  0x010e9975 in Finternal_set_lisp_face_attribute (face=58325890,
    attr=58296898, value=512, frame=61322709) at xfaces.c:3233
#9  0x01185d95 in Ffuncall (nargs=5, args=0x82e1a4) at eval.c:2822
#10 0x011c67a9 in exec_byte_code (bytestr=19629633, vector=19629653,
    maxdepth=28, args_template=58296354, nargs=0, args=0x0) at bytecode.c:916
#11 0x011868da in funcall_lambda (fun=19629597, nargs=4,
    arg_vector=0x12b8655 <pure+257109>) at eval.c:3044
#12 0x01185f42 in Ffuncall (nargs=5, args=0x82e4a0) at eval.c:2860
#13 0x01185268 in Fapply (nargs=4, args=0x82e5a8) at eval.c:2350
#14 0x01185bfb in Ffuncall (nargs=5, args=0x82e5a4) at eval.c:2792
#15 0x011c67a9 in exec_byte_code (bytestr=19638793, vector=19638813,
    maxdepth=24, args_template=58296354, nargs=0, args=0x0) at bytecode.c:916
#16 0x011868da in funcall_lambda (fun=19638757, nargs=3,
    arg_vector=0x12baa1d <pure+266269>) at eval.c:3044
#17 0x01185f42 in Ffuncall (nargs=4, args=0x82e8a4) at eval.c:2860
#18 0x011c67a9 in exec_byte_code (bytestr=19638649, vector=19638669,
    maxdepth=20, args_template=58296354, nargs=0, args=0x0) at bytecode.c:916
#19 0x011868da in funcall_lambda (fun=19638629, nargs=2,
    arg_vector=0x12ba98d <pure+266125>) at eval.c:3044
#20 0x01186216 in apply_lambda (fun=19638629, args=58677654, count=13)
    at eval.c:2919
#21 0x01184bcf in eval_sub (form=58677678) at eval.c:2226
#22 0x011841dd in Feval (form=58677678, lexical=58296354) at eval.c:1996
#23 0x01185d2e in Ffuncall (nargs=3, args=0x82ed4c) at eval.c:2814
#24 0x011c67a9 in exec_byte_code (bytestr=20150481, vector=20150501,
    maxdepth=20, args_template=1028, nargs=1, args=0x82f050) at bytecode.c:916
#25 0x01186516 in funcall_lambda (fun=20150461, nargs=1, arg_vector=0x82f04c)
    at eval.c:2978
#26 0x01185f42 in Ffuncall (nargs=2, args=0x82f048) at eval.c:2860
#27 0x011c67a9 in exec_byte_code (bytestr=20150857, vector=20150877,
    maxdepth=16, args_template=1028, nargs=1, args=0x82f398) at bytecode.c:916
#28 0x01186516 in funcall_lambda (fun=20150829, nargs=1, arg_vector=0x82f394)
    at eval.c:2978
#29 0x01185f42 in Ffuncall (nargs=2, args=0x82f390) at eval.c:2860
#30 0x0117f504 in Fcall_interactively (function=60483810,
    record_flag=58296354, keys=58317685) at callint.c:836
#31 0x01185d5d in Ffuncall (nargs=4, args=0x82f57c) at eval.c:2818
#32 0x011c67a9 in exec_byte_code (bytestr=19837345, vector=19837365,
    maxdepth=52, args_template=4100, nargs=1, args=0x82f890) at bytecode.c:916
#33 0x01186516 in funcall_lambda (fun=19837325, nargs=1, arg_vector=0x82f88c)
    at eval.c:2978
#34 0x01185f42 in Ffuncall (nargs=2, args=0x82f888) at eval.c:2860
#35 0x011857ec in call1 (fn=58342562, arg1=60483810) at eval.c:2610
#36 0x010f97bf in command_loop_1 () at keyboard.c:1560
#37 0x01182c4f in internal_condition_case (bfun=0x10f915e <command_loop_1>,
    handlers=58347874, hfun=0x10f89c3 <cmd_error>) at eval.c:1348
#38 0x010f8e13 in command_loop_2 (ignore=58296354) at keyboard.c:1178
#39 0x011821ff in internal_catch (tag=58343234,
    func=0x10f8def <command_loop_2>, arg=58296354) at eval.c:1112
#40 0x010f8dc9 in command_loop () at keyboard.c:1157
#41 0x010f8560 in recursive_edit_1 () at keyboard.c:778
#42 0x010f871c in Frecursive_edit () at keyboard.c:849
#43 0x010f6936 in main (argc=2, argv=0xa427e0) at emacs.c:1642

Lisp Backtrace:
"internal-set-lisp-face-attribute" (0x82e1a8)
"set-face-attribute" (0x82e4a4)
"apply" (0x82e5a8)
"face-spec-set-2" (0x82e8a8)
"face-spec-recalc" (0x82eb30)
"eval" (0x82ed50)
"eval-last-sexp-1" (0x82f04c)
"eval-last-sexp" (0x82f394)
"call-interactively" (0x82f580)
"command-execute" (0x82f88c)