From: Jan D Date: Fri, 13 Aug 2010 13:26:13 +0000 (+0200) Subject: Fix handling of tool-bar-position, also put into default-frame-alist. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~48^2~306 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2b4e627726bc1dfcbf95f069fb97f932471efad8;p=emacs.git Fix handling of tool-bar-position, also put into default-frame-alist. * lisp/menu-bar.el (menu-bar-set-tool-bar-position): New function. (menu-bar-showhide-tool-bar-menu-customize-enable-left) (menu-bar-showhide-tool-bar-menu-customize-enable-right) (menu-bar-showhide-tool-bar-menu-customize-enable-top) (menu-bar-showhide-tool-bar-menu-customize-enable-bottom): Call menu-bar-set-tool-bar-position. * src/frame.h (Qtool_bar_position): Declare. * src/xfns.c (Fx_create_frame): Call x_default_parameter for Qtool_bar_position. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 868d9822b85..d61c11b4ef5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2010-08-13 Jan Djärv + + * menu-bar.el (menu-bar-set-tool-bar-position): New function. + (menu-bar-showhide-tool-bar-menu-customize-enable-left) + (menu-bar-showhide-tool-bar-menu-customize-enable-right) + (menu-bar-showhide-tool-bar-menu-customize-enable-top) + (menu-bar-showhide-tool-bar-menu-customize-enable-bottom): Call + menu-bar-set-tool-bar-position. + 2010-08-12 Stefan Monnier * progmodes/octave-mod.el (octave-mode-syntax-table): Use the new "c" diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 626472605ff..3c1241237f1 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -968,6 +968,14 @@ mail status in mode line")) :help ,(purecopy "Turn menu-bar on/off") :button (:toggle . (> (frame-parameter nil 'menu-bar-lines) 0)))) +(defun menu-bar-set-tool-bar-position (position) + (customize-set-variable 'tool-bar-mode t) + (set-frame-parameter nil 'tool-bar-position position) + (customize-set-variable 'default-frame-alist + (cons (cons 'tool-bar-position position) + (assq-delete-all 'tool-bar-position + default-frame-alist)))) + (defun menu-bar-showhide-tool-bar-menu-customize-disable () "Do not display tool bars." (interactive) @@ -975,24 +983,20 @@ mail status in mode line")) (defun menu-bar-showhide-tool-bar-menu-customize-enable-left () "Display tool bars on the left side." (interactive) - (customize-set-variable 'tool-bar-mode t) - (set-frame-parameter nil 'tool-bar-position 'left)) + (menu-bar-set-tool-bar-position 'left)) (defun menu-bar-showhide-tool-bar-menu-customize-enable-right () "Display tool bars on the right side." (interactive) - (customize-set-variable 'tool-bar-mode t) - (set-frame-parameter nil 'tool-bar-position 'right)) + (menu-bar-set-tool-bar-position 'right)) (defun menu-bar-showhide-tool-bar-menu-customize-enable-top () "Display tool bars on the top side." (interactive) - (customize-set-variable 'tool-bar-mode t) - (set-frame-parameter nil 'tool-bar-position 'top)) + (menu-bar-set-tool-bar-position 'top)) (defun menu-bar-showhide-tool-bar-menu-customize-enable-bottom () "Display tool bars on the bottom side." (interactive) - (customize-set-variable 'tool-bar-mode t) - (set-frame-parameter nil 'tool-bar-position 'bottom)) + (menu-bar-set-tool-bar-position 'bottom)) (if (featurep 'move-toolbar) (progn diff --git a/src/ChangeLog b/src/ChangeLog index 024cf18efb6..69b1e9866d5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2010-08-13 Jan Djärv + + * frame.h (Qtool_bar_position): Declare. + + * xfns.c (Fx_create_frame): Call x_default_parameter for + Qtool_bar_position. + 2010-08-13 Eli Zaretskii * unexcoff.c: Remove the parts used when "emacs" is not defined. diff --git a/src/frame.h b/src/frame.h index 088b477dfce..6b307c7c3b1 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1050,7 +1050,7 @@ extern Lisp_Object Qbackground_color, Qforeground_color; extern Lisp_Object Qicon, Qicon_name, Qicon_type, Qicon_left, Qicon_top; extern Lisp_Object Qinternal_border_width; extern Lisp_Object Qtooltip; -extern Lisp_Object Qmenu_bar_lines, Qtool_bar_lines; +extern Lisp_Object Qmenu_bar_lines, Qtool_bar_lines, Qtool_bar_position; extern Lisp_Object Qmouse_color; extern Lisp_Object Qname, Qtitle; extern Lisp_Object Qparent_id; diff --git a/src/xfns.c b/src/xfns.c index e2d571a847f..cb6733e8fa1 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3392,6 +3392,8 @@ This function is an internal primitive--use `make-frame' instead. */) "waitForWM", "WaitForWM", RES_TYPE_BOOLEAN); x_default_parameter (f, parms, Qfullscreen, Qnil, "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); + x_default_parameter (f, parms, Qtool_bar_position, + f->tool_bar_position, 0, 0, RES_TYPE_SYMBOL); /* Compute the size of the X window. */ window_prompting = x_figure_window_size (f, parms, 1);