From: Jan Djärv Date: Mon, 22 Mar 2010 07:26:56 +0000 (+0100) Subject: bug #5736: Allow X-resource menuBar to take on/off as documented. X-Git-Tag: emacs-pretest-23.1.95~53 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=93318cbd4081abd95958485429b6fc497089b26e;p=emacs.git bug #5736: Allow X-resource menuBar to take on/off as documented. * frame.c (x_get_arg): Handle RES_TYPE_BOOLEAN_NUMBER (bug #5736). * xfns.c (Fx_create_frame): Make menuBar a RES_TYPE_BOOLEAN_NUMBER. * dispextern.h (resource_types): RES_TYPE_BOOLEAN_NUMBER is new. * xresources.texi (Table of Resources): Clarify toolBar number for Gtk+. * frames.texi (Menu Bars): menuBarLines => menuBar (bug#5736). --- diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 0e532345c7c..033e7b19270 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,10 @@ +2010-03-20 Jan Djärv + + * xresources.texi (Table of Resources): Clarify toolBar number + for Gtk+. + + * frames.texi (Menu Bars): menuBarLines => menuBar (bug#5736). + 2010-03-21 Chong Yidong * dired.texi (Dired Updating): Document dired-auto-revert-buffer. @@ -18,6 +25,7 @@ * xresources.texi (Table of Resources): * mule.texi (Defining Fontsets, Charsets): Update xrefs. +>>>>>>> MERGE-SOURCE 2010-03-06 Chong Yidong * custom.texi (Init Examples): Add xref to Locals. diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 0d3229b7388..b4a8500df65 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -1224,7 +1224,7 @@ menu-bar-mode} or by customizing the variable @code{menu-bar-mode}. With no argument, this command toggles Menu Bar mode, a minor mode. With an argument, the command turns Menu Bar mode on if the argument is positive, off if the argument is not positive. You can use -the X resource @samp{menuBarLines} to control the initial setting of +the X resource @samp{menuBar} to control the initial setting of Menu Bar mode. @xref{Resources}. @kindex C-Mouse-3 @r{(when menu bar is disabled)} diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi index 62f0448b92e..75b6e3bbe4c 100644 --- a/doc/emacs/xresources.texi +++ b/doc/emacs/xresources.texi @@ -307,12 +307,14 @@ Name to display in the title bar of the initial Emacs frame. @item @code{toolBar} (class @code{ToolBar}) @cindex tool bar Number of lines to reserve for the tool bar. A zero value suppresses -the tool bar. If the value is non-zero and -@code{auto-resize-tool-bars} is non-@code{nil}, the tool bar's size -will be changed automatically so that all tool bar items are visible. +the tool bar. For the Emacs tool bar (i.e. not Gtk+), if the value is +non-zero and @code{auto-resize-tool-bars} is non-@code{nil}, the tool bar's +size will be changed automatically so that all tool bar items are visible. If the value of @code{auto-resize-tool-bars} is @code{grow-only}, the tool bar expands automatically, but does not contract automatically. To contract the tool bar, you must redraw the frame by entering @kbd{C-l}. +For the Gtk+ tool bar, any non-zero value means on and +@code{auto-resize-tool-bars} has no effect. @item @code{useXIM} (class @code{UseXIM}) @cindex XIM diff --git a/src/ChangeLog b/src/ChangeLog index cf9d0fd9bea..2609125f9fe 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2010-03-20 Jan Djärv + + * frame.c (x_get_arg): Handle RES_TYPE_BOOLEAN_NUMBER (bug #5736). + + * xfns.c (Fx_create_frame): Make menuBar a RES_TYPE_BOOLEAN_NUMBER. + + * dispextern.h (resource_types): RES_TYPE_BOOLEAN_NUMBER is new. + 2010-03-20 YAMAMOTO Mitsuharu * xfns.c (Fx_create_frame) [USE_LUCID]: Add BLOCK_INPUT around diff --git a/src/dispextern.h b/src/dispextern.h index 01ba3f54181..22d44fc9083 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3122,7 +3122,8 @@ enum resource_types RES_TYPE_FLOAT, RES_TYPE_BOOLEAN, RES_TYPE_STRING, - RES_TYPE_SYMBOL + RES_TYPE_SYMBOL, + RES_TYPE_BOOLEAN_NUMBER }; extern Lisp_Object x_get_arg P_ ((Display_Info *, Lisp_Object, diff --git a/src/frame.c b/src/frame.c index f05f9f751da..5915c00bca1 100644 --- a/src/frame.c +++ b/src/frame.c @@ -4005,6 +4005,13 @@ x_get_arg (dpyinfo, alist, param, attribute, class, type) case RES_TYPE_NUMBER: return make_number (atoi (SDATA (tem))); + case RES_TYPE_BOOLEAN_NUMBER: + if (!strcmp (SDATA (tem), "on") + || !strcmp (SDATA (tem), "true")) + return make_number (1); + return make_number (atoi (SDATA (tem))); + break; + case RES_TYPE_FLOAT: return make_float (atof (SDATA (tem))); diff --git a/src/xfns.c b/src/xfns.c index b11a7a5e91a..6d041708eec 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3418,7 +3418,7 @@ This function is an internal primitive--use `make-frame' instead. */) init_frame_faces (f); x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1), - "menuBar", "MenuBar", RES_TYPE_NUMBER); + "menuBar", "MenuBar", RES_TYPE_BOOLEAN_NUMBER); x_default_parameter (f, parms, Qtool_bar_lines, make_number (1), "toolBar", "ToolBar", RES_TYPE_NUMBER); x_default_parameter (f, parms, Qbuffer_predicate, Qnil,