aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2010-06-26 20:30:52 -0400
committerChong Yidong2010-06-26 20:30:52 -0400
commit6431f2e619d1ce4cff097a3837f6b9e931f1f61a (patch)
treedbb4f0ef7419becd60a7a03b5f0b2558f258594f /src
parent394f238630dc4904435c15dad92727a900916b97 (diff)
downloademacs-6431f2e619d1ce4cff097a3837f6b9e931f1f61a.tar.gz
emacs-6431f2e619d1ce4cff097a3837f6b9e931f1f61a.zip
Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Don't add entries for `menu-bar-lines' and `tool-bar-lines' to `default-frame-alist' and `initial-frame-alist' at startup. Instead, use X resources to update the `menu-bar-mode' and `tool-bar-mode' variables at startup, and use them as defaults during frame creation. * lisp/frame.el (frame-notice-user-settings): Don't change default-frame-alist based on menu-bar-mode and tool-bar-mode, or vice versa. * lisp/menu-bar.el (menu-bar-mode): * lisp/tool-bar.el (tool-bar-mode): Don't change default-frame-alist. Set init-value to t. * lisp/startup.el (command-line): Use X resources to set the value of menu-bar-mode and tool-bar-mode, before calling frame-initialize. * src/frame.c (Vmenu_bar_mode, Vtool_bar_mode): New vars. * src/w32fns.c (Fx_create_frame): * src/nsfns.m (Fx_create_frame): Likewise. * src/xfns.c (Fx_create_frame): Don't consult X resouces when setting menu-bar-lines and tool-bar-lines. Use menu-bar-mode and tool-bar-mode, which are now set using these X resources at startup, to determine the defaults.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/frame.c9
-rw-r--r--src/nsfns.m16
-rw-r--r--src/w32fns.c16
-rw-r--r--src/xfns.c18
5 files changed, 59 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9777ab2202b..a7de72e3f95 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
12010-06-27 Chong Yidong <cyd@stupidchicken.com>
2
3 * xfns.c (Fx_create_frame): Don't consult X resouces when setting
4 menu-bar-lines and tool-bar-lines. Use menu-bar-mode and
5 tool-bar-mode, which are now set using these X resources at
6 startup, to determine the defaults (Bug#2249).
7
8 * w32fns.c (Fx_create_frame):
9 * nsfns.m (Fx_create_frame): Likewise.
10
11 * frame.c (Vmenu_bar_mode, Vtool_bar_mode): New vars.
12
12010-06-24 Juanma Barranquero <lekktu@gmail.com> 132010-06-24 Juanma Barranquero <lekktu@gmail.com>
2 14
3 * gtkutil.c (xg_update_scrollbar_pos): 15 * gtkutil.c (xg_update_scrollbar_pos):
diff --git a/src/frame.c b/src/frame.c
index 3e1b2daf556..f542595e5f5 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -119,6 +119,7 @@ Lisp_Object Qtitle, Qname;
119Lisp_Object Qexplicit_name; 119Lisp_Object Qexplicit_name;
120Lisp_Object Qunsplittable; 120Lisp_Object Qunsplittable;
121Lisp_Object Qmenu_bar_lines, Qtool_bar_lines; 121Lisp_Object Qmenu_bar_lines, Qtool_bar_lines;
122Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
122Lisp_Object Qleft_fringe, Qright_fringe; 123Lisp_Object Qleft_fringe, Qright_fringe;
123Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list; 124Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
124Lisp_Object Qtty_color_mode; 125Lisp_Object Qtty_color_mode;
@@ -4648,6 +4649,14 @@ recursively). */);
4648 Qdelete_frame_functions = intern_c_string ("delete-frame-functions"); 4649 Qdelete_frame_functions = intern_c_string ("delete-frame-functions");
4649 staticpro (&Qdelete_frame_functions); 4650 staticpro (&Qdelete_frame_functions);
4650 4651
4652 DEFVAR_LISP ("menu-bar-mode", &Vmenu_bar_mode,
4653 doc: /* Non-nil if Menu-Bar mode is enabled. */);
4654 Vmenu_bar_mode = Qt;
4655
4656 DEFVAR_LISP ("tool-bar-mode", &Vtool_bar_mode,
4657 doc: /* Non-nil if Tool-Bar mode is enabled. */);
4658 Vtool_bar_mode = Qt;
4659
4651 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame, 4660 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
4652 doc: /* Minibufferless frames use this frame's minibuffer. 4661 doc: /* Minibufferless frames use this frame's minibuffer.
4653 4662
diff --git a/src/nsfns.m b/src/nsfns.m
index 53264a5f595..d05fcf451e7 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1234,10 +1234,18 @@ be shared by the new frame. */)
1234 1234
1235 init_frame_faces (f); 1235 init_frame_faces (f);
1236 1236
1237 x_default_parameter (f, parms, Qmenu_bar_lines, make_number (0), "menuBar", 1237 /* The X resources controlling the menu-bar and tool-bar are
1238 "menuBar", RES_TYPE_NUMBER); 1238 processed specially at startup, and reflected in the mode
1239 x_default_parameter (f, parms, Qtool_bar_lines, make_number (0), "toolBar", 1239 variables; ignore them here. */
1240 "toolBar", RES_TYPE_NUMBER); 1240 x_default_parameter (f, parms, Qmenu_bar_lines,
1241 NILP (Vmenu_bar_mode)
1242 ? make_number (0) : make_number (1),
1243 NULL, NULL, RES_TYPE_NUMBER);
1244 x_default_parameter (f, parms, Qtool_bar_lines,
1245 NILP (Vtool_bar_mode)
1246 ? make_number (0) : make_number (1),
1247 NULL, NULL, RES_TYPE_NUMBER);
1248
1241 x_default_parameter (f, parms, Qbuffer_predicate, Qnil, "bufferPredicate", 1249 x_default_parameter (f, parms, Qbuffer_predicate, Qnil, "bufferPredicate",
1242 "BufferPredicate", RES_TYPE_SYMBOL); 1250 "BufferPredicate", RES_TYPE_SYMBOL);
1243 x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title", 1251 x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title",
diff --git a/src/w32fns.c b/src/w32fns.c
index bc310da0d2f..f498539a568 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -290,6 +290,7 @@ static unsigned menu_free_timer = 0;
290 290
291/* The below are defined in frame.c. */ 291/* The below are defined in frame.c. */
292 292
293extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
293extern Lisp_Object Vwindow_system_version; 294extern Lisp_Object Vwindow_system_version;
294 295
295#ifdef GLYPH_DEBUG 296#ifdef GLYPH_DEBUG
@@ -4462,10 +4463,17 @@ This function is an internal primitive--use `make-frame' instead. */)
4462 happen. */ 4463 happen. */
4463 init_frame_faces (f); 4464 init_frame_faces (f);
4464 4465
4465 x_default_parameter (f, parameters, Qmenu_bar_lines, make_number (1), 4466 /* The X resources controlling the menu-bar and tool-bar are
4466 "menuBar", "MenuBar", RES_TYPE_NUMBER); 4467 processed specially at startup, and reflected in the mode
4467 x_default_parameter (f, parameters, Qtool_bar_lines, make_number (1), 4468 variables; ignore them here. */
4468 "toolBar", "ToolBar", RES_TYPE_NUMBER); 4469 x_default_parameter (f, parameters, Qmenu_bar_lines,
4470 NILP (Vmenu_bar_mode)
4471 ? make_number (0) : make_number (1),
4472 NULL, NULL, RES_TYPE_NUMBER);
4473 x_default_parameter (f, parameters, Qtool_bar_lines,
4474 NILP (Vtool_bar_mode)
4475 ? make_number (0) : make_number (1),
4476 NULL, NULL, RES_TYPE_NUMBER);
4469 4477
4470 x_default_parameter (f, parameters, Qbuffer_predicate, Qnil, 4478 x_default_parameter (f, parameters, Qbuffer_predicate, Qnil,
4471 "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL); 4479 "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
diff --git a/src/xfns.c b/src/xfns.c
index 4f9afeef6cc..516aaaffc93 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -204,6 +204,8 @@ extern Lisp_Object Vsystem_name;
204 204
205/* The below are defined in frame.c. */ 205/* The below are defined in frame.c. */
206 206
207extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
208
207#if GLYPH_DEBUG 209#if GLYPH_DEBUG
208int image_cache_refcount, dpyinfo_refcount; 210int image_cache_refcount, dpyinfo_refcount;
209#endif 211#endif
@@ -3450,10 +3452,18 @@ This function is an internal primitive--use `make-frame' instead. */)
3450 happen. */ 3452 happen. */
3451 init_frame_faces (f); 3453 init_frame_faces (f);
3452 3454
3453 x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1), 3455 /* The X resources controlling the menu-bar and tool-bar are
3454 "menuBar", "MenuBar", RES_TYPE_BOOLEAN_NUMBER); 3456 processed specially at startup, and reflected in the mode
3455 x_default_parameter (f, parms, Qtool_bar_lines, make_number (1), 3457 variables; ignore them here. */
3456 "toolBar", "ToolBar", RES_TYPE_NUMBER); 3458 x_default_parameter (f, parms, Qmenu_bar_lines,
3459 NILP (Vmenu_bar_mode)
3460 ? make_number (0) : make_number (1),
3461 NULL, NULL, RES_TYPE_NUMBER);
3462 x_default_parameter (f, parms, Qtool_bar_lines,
3463 NILP (Vtool_bar_mode)
3464 ? make_number (0) : make_number (1),
3465 NULL, NULL, RES_TYPE_NUMBER);
3466
3457 x_default_parameter (f, parms, Qbuffer_predicate, Qnil, 3467 x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
3458 "bufferPredicate", "BufferPredicate", 3468 "bufferPredicate", "BufferPredicate",
3459 RES_TYPE_SYMBOL); 3469 RES_TYPE_SYMBOL);