diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-02-24 22:41:40 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-02-24 22:41:40 -0800 |
commit | a89654f8f34114db543cb91363e8fded6d73e986 (patch) | |
tree | 5ac508597ef2aa460308b4b26c244779e48cdb40 /src/xfns.c | |
parent | 6e6c82a4e687708d5a7a3887f92db45bd74da276 (diff) | |
parent | 67b0de11479247cb8bd8491e10e0b464046f18be (diff) | |
download | emacs-a89654f8f34114db543cb91363e8fded6d73e986.tar.gz |
Merge from trunk.
Diffstat (limited to 'src/xfns.c')
-rw-r--r-- | src/xfns.c | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/src/xfns.c b/src/xfns.c index b0cef7221f8..4cf4a059a67 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -2949,6 +2949,12 @@ unwind_create_frame (Lisp_Object frame) return Qnil; } +static Lisp_Object +unwind_create_frame_1 (Lisp_Object val) +{ + inhibit_window_configuration_change_hook = val; + return Qnil; +} static void x_default_font_parameter (struct frame *f, Lisp_Object parms) @@ -3321,17 +3327,31 @@ This function is an internal primitive--use `make-frame' instead. */) happen. */ init_frame_faces (f); - /* The X resources controlling the menu-bar and tool-bar are - processed specially at startup, and reflected in the mode - variables; ignore them here. */ - x_default_parameter (f, parms, Qmenu_bar_lines, - NILP (Vmenu_bar_mode) - ? make_number (0) : make_number (1), - NULL, NULL, RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qtool_bar_lines, - NILP (Vtool_bar_mode) - ? make_number (0) : make_number (1), - NULL, NULL, RES_TYPE_NUMBER); + /* Set the menu-bar-lines and tool-bar-lines parameters. We don't + look up the X resources controlling the menu-bar and tool-bar + here; they are processed specially at startup, and reflected in + the values of the mode variables. + + Avoid calling window-configuration-change-hook; otherwise we + could get an infloop in next_frame since the frame is not yet in + Vframe_list. */ + { + ptrdiff_t count2 = SPECPDL_INDEX (); + record_unwind_protect (unwind_create_frame_1, + inhibit_window_configuration_change_hook); + inhibit_window_configuration_change_hook = Qt; + + x_default_parameter (f, parms, Qmenu_bar_lines, + NILP (Vmenu_bar_mode) + ? make_number (0) : make_number (1), + NULL, NULL, RES_TYPE_NUMBER); + x_default_parameter (f, parms, Qtool_bar_lines, + NILP (Vtool_bar_mode) + ? make_number (0) : make_number (1), + NULL, NULL, RES_TYPE_NUMBER); + + unbind_to (count2, Qnil); + } x_default_parameter (f, parms, Qbuffer_predicate, Qnil, "bufferPredicate", "BufferPredicate", |