Mercurial > emacs
diff lisp/menu-bar.el @ 109771:3c2274d0da65
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.
author | Jan D <jan.h.d@swipnet.se> |
---|---|
date | Fri, 13 Aug 2010 15:26:13 +0200 |
parents | 06384b3caebf |
children | 53205019b195 |
line wrap: on
line diff
--- a/lisp/menu-bar.el Fri Aug 13 14:09:51 2010 +0300 +++ b/lisp/menu-bar.el Fri Aug 13 15:26:13 2010 +0200 @@ -968,6 +968,14 @@ :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 @@ (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