Subject: Re: bug#25228: 25.1; GNU emacs 25.1: custom-set-faces from init file ~/.emacs ignored

From: "Dr. Werner Fink" <[email-masked]>
Date: Wed, 21 Dec 2016 13:08:26 +0100

On Wed, Dec 21, 2016 at 09:48:56AM +0100, martin rudalics wrote:
> > Nevertheless, with the custom font setting and without my change in lisp/dynamic-setting.el
> > the resize event of the GNU Emacs window is back and still the system font is
> > used regardless what font has been customized in ~/.emacs
> 
> In that case do you get a backtrace that includes
> `dynamic-setting-handle-config-changed-event'?

The variable changed becomes changed due to the font changed

(gdb) 
~"638\t      changed = true;\n"
*stopped,reason="end-stepping-range",frame={addr="0x00000000004da770",func="apply_xft_settings",args=[{name="settings",value="0x7fffffffc510"},{name="dpyinfo",value="0x166fe20"}],file="xsettings.c",fullname="/usr/src/werner/emacs/emacs-25.1/src/xsettings.c",line="638"},thread-id="1",stopped-threads="all",core="5"
(gdb) 
list
&"list\n"
~"633\t  if ((settings->seen & SEEN_HINTING) != 0\n"
~"634\t      && oldsettings.hinting != settings->hinting)\n"
~"635\t    {\n"
~"636\t      FcPatternDel (pat, FC_HINTING);\n"
~"637\t      FcPatternAddBool (pat, FC_HINTING, settings->hinting);\n"
~"638\t      changed = true;\n"
~"639\t      oldsettings.hinting = settings->hinting;\n"
~"640\t    }\n"
~"641\t  if ((settings->seen & SEEN_RGBA) != 0 && oldsettings.rgba != settings->rgba)\n"
~"642\t    {\n"

(gdb) 
~"646\t      changed = true;\n"
*stopped,reason="end-stepping-range",frame={addr="0x00000000004da7bf",func="apply_xft_settings",args=[{name="settings",value="0x7fffffffc510"},{name="dpyinfo",value="0x166fe20"}],file="xsettings.c",fullname="/usr/src/werner/emacs/emacs-25.1/src/xsettings.c",line="646"},thread-id="1",stopped-threads="all",core="4"
(gdb) 
list
&"list\n"
~"641\t  if ((settings->seen & SEEN_RGBA) != 0 && oldsettings.rgba != settings->rgba)\n"
~"642\t    {\n"
~"643\t      FcPatternDel (pat, FC_RGBA);\n"
~"644\t      FcPatternAddInteger (pat, FC_RGBA, settings->rgba);\n"
~"645\t      oldsettings.rgba = settings->rgba;\n"
~"646\t      changed = true;\n"
~"647\t    }\n"
~"648\t\n"
~"649\t  /* Older fontconfig versions don't have FC_LCD_FILTER. */\n"
~"650\t  if ((settings->seen & SEEN_LCDFILTER) != 0\n"

(gdb) 
~"655\t      changed = true;\n"
*stopped,reason="end-stepping-range",frame={addr="0x00000000004da80e",func="apply_xft_settings",args=[{name="settings",value="0x7fffffffc510"},{name="dpyinfo",value="0x166fe20"}],file="xsettings.c",fullname="/usr/src/werner/emacs/emacs-25.1/src/xsettings.c",line="655"},thread-id="1",stopped-threads="all",core="4"
(gdb) 
list
&"list\n"
~"650\t  if ((settings->seen & SEEN_LCDFILTER) != 0\n"
~"651\t      && oldsettings.lcdfilter != settings->lcdfilter)\n"
~"652\t    {\n"
~"653\t      FcPatternDel (pat, FC_LCD_FILTER);\n"
~"654\t      FcPatternAddInteger (pat, FC_LCD_FILTER, settings->lcdfilter);\n"
~"655\t      changed = true;\n"
~"656\t      oldsettings.lcdfilter = settings->lcdfilter;\n"
~"657\t    }\n"
~"658\t\n"
~"659\t#ifdef FC_HINT_STYLE\n"
^done
(gdb) 

(gdb) 
~"665\t      changed = true;\n"
*stopped,reason="end-stepping-range",frame={addr="0x00000000004da85d",func="apply_xft_settings",args=[{name="settings",value="0x7fffffffc510"},{name="dpyinfo",value="0x166fe20"}],file="xsettings.c",fullname="/usr/src/werner/emacs/emacs-25.1/src/xsettings.c",line="665"},thread-id="1",stopped-threads="all",core="4"
(gdb) 
list
&"list\n"
~"660\t  if ((settings->seen & SEEN_HINTSTYLE) != 0\n"
~"661\t      && oldsettings.hintstyle != settings->hintstyle)\n"
~"662\t    {\n"
~"663\t      FcPatternDel (pat, FC_HINT_STYLE);\n"
~"664\t      FcPatternAddInteger (pat, FC_HINT_STYLE, settings->hintstyle);\n"
~"665\t      changed = true;\n"
~"666\t      oldsettings.hintstyle = settings->hintstyle;\n"
~"667\t    }\n"
~"668\t#endif\n"
~"669\t\n"
^done
(gdb) 

now breakpoint at x_new_font() and aftersome c I see with bt

~"\n"
~"Lisp Backtrace:\n"
~"\"internal-set-lisp-face-attribute\""
~" (0xffffa740)\n"
~"\"set-face-attribute\""
~" (0xffffa930)\n"
~"\"font-setting-change-default-font\""
~" (0xffffab50)\n"
~"\"dynamic-setting-handle-config-changed-event\""
~" (0xffffae00)\n"
~"\"funcall-interactively\""
~" (0xffffadf8)\n"
~"\"call-interactively\""

which is a hit

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr