aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan D2010-08-13 15:26:13 +0200
committerJan D2010-08-13 15:26:13 +0200
commit2b4e627726bc1dfcbf95f069fb97f932471efad8 (patch)
tree8dad1c6b6bafa7531bdac10e432742258ddae9f5
parent9dec0f7642296c34dfd3700c6094808ce6ed289e (diff)
downloademacs-2b4e627726bc1dfcbf95f069fb97f932471efad8.tar.gz
emacs-2b4e627726bc1dfcbf95f069fb97f932471efad8.zip
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.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/menu-bar.el20
-rw-r--r--src/ChangeLog7
-rw-r--r--src/frame.h2
-rw-r--r--src/xfns.c2
5 files changed, 31 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 868d9822b85..d61c11b4ef5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12010-08-13 Jan Djärv <jan.h.d@swipnet.se>
2
3 * menu-bar.el (menu-bar-set-tool-bar-position): New function.
4 (menu-bar-showhide-tool-bar-menu-customize-enable-left)
5 (menu-bar-showhide-tool-bar-menu-customize-enable-right)
6 (menu-bar-showhide-tool-bar-menu-customize-enable-top)
7 (menu-bar-showhide-tool-bar-menu-customize-enable-bottom): Call
8 menu-bar-set-tool-bar-position.
9
12010-08-12 Stefan Monnier <monnier@iro.umontreal.ca> 102010-08-12 Stefan Monnier <monnier@iro.umontreal.ca>
2 11
3 * progmodes/octave-mod.el (octave-mode-syntax-table): Use the new "c" 12 * 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"))
968 :help ,(purecopy "Turn menu-bar on/off") 968 :help ,(purecopy "Turn menu-bar on/off")
969 :button (:toggle . (> (frame-parameter nil 'menu-bar-lines) 0)))) 969 :button (:toggle . (> (frame-parameter nil 'menu-bar-lines) 0))))
970 970
971(defun menu-bar-set-tool-bar-position (position)
972 (customize-set-variable 'tool-bar-mode t)
973 (set-frame-parameter nil 'tool-bar-position position)
974 (customize-set-variable 'default-frame-alist
975 (cons (cons 'tool-bar-position position)
976 (assq-delete-all 'tool-bar-position
977 default-frame-alist))))
978
971(defun menu-bar-showhide-tool-bar-menu-customize-disable () 979(defun menu-bar-showhide-tool-bar-menu-customize-disable ()
972 "Do not display tool bars." 980 "Do not display tool bars."
973 (interactive) 981 (interactive)
@@ -975,24 +983,20 @@ mail status in mode line"))
975(defun menu-bar-showhide-tool-bar-menu-customize-enable-left () 983(defun menu-bar-showhide-tool-bar-menu-customize-enable-left ()
976 "Display tool bars on the left side." 984 "Display tool bars on the left side."
977 (interactive) 985 (interactive)
978 (customize-set-variable 'tool-bar-mode t) 986 (menu-bar-set-tool-bar-position 'left))
979 (set-frame-parameter nil 'tool-bar-position 'left))
980 987
981(defun menu-bar-showhide-tool-bar-menu-customize-enable-right () 988(defun menu-bar-showhide-tool-bar-menu-customize-enable-right ()
982 "Display tool bars on the right side." 989 "Display tool bars on the right side."
983 (interactive) 990 (interactive)
984 (customize-set-variable 'tool-bar-mode t) 991 (menu-bar-set-tool-bar-position 'right))
985 (set-frame-parameter nil 'tool-bar-position 'right))
986(defun menu-bar-showhide-tool-bar-menu-customize-enable-top () 992(defun menu-bar-showhide-tool-bar-menu-customize-enable-top ()
987 "Display tool bars on the top side." 993 "Display tool bars on the top side."
988 (interactive) 994 (interactive)
989 (customize-set-variable 'tool-bar-mode t) 995 (menu-bar-set-tool-bar-position 'top))
990 (set-frame-parameter nil 'tool-bar-position 'top))
991(defun menu-bar-showhide-tool-bar-menu-customize-enable-bottom () 996(defun menu-bar-showhide-tool-bar-menu-customize-enable-bottom ()
992 "Display tool bars on the bottom side." 997 "Display tool bars on the bottom side."
993 (interactive) 998 (interactive)
994 (customize-set-variable 'tool-bar-mode t) 999 (menu-bar-set-tool-bar-position 'bottom))
995 (set-frame-parameter nil 'tool-bar-position 'bottom))
996 1000
997(if (featurep 'move-toolbar) 1001(if (featurep 'move-toolbar)
998 (progn 1002 (progn
diff --git a/src/ChangeLog b/src/ChangeLog
index 024cf18efb6..69b1e9866d5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12010-08-13 Jan Djärv <jan.h.d@swipnet.se>
2
3 * frame.h (Qtool_bar_position): Declare.
4
5 * xfns.c (Fx_create_frame): Call x_default_parameter for
6 Qtool_bar_position.
7
12010-08-13 Eli Zaretskii <eliz@gnu.org> 82010-08-13 Eli Zaretskii <eliz@gnu.org>
2 9
3 * unexcoff.c: Remove the parts used when "emacs" is not defined. 10 * 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;
1050extern Lisp_Object Qicon, Qicon_name, Qicon_type, Qicon_left, Qicon_top; 1050extern Lisp_Object Qicon, Qicon_name, Qicon_type, Qicon_left, Qicon_top;
1051extern Lisp_Object Qinternal_border_width; 1051extern Lisp_Object Qinternal_border_width;
1052extern Lisp_Object Qtooltip; 1052extern Lisp_Object Qtooltip;
1053extern Lisp_Object Qmenu_bar_lines, Qtool_bar_lines; 1053extern Lisp_Object Qmenu_bar_lines, Qtool_bar_lines, Qtool_bar_position;
1054extern Lisp_Object Qmouse_color; 1054extern Lisp_Object Qmouse_color;
1055extern Lisp_Object Qname, Qtitle; 1055extern Lisp_Object Qname, Qtitle;
1056extern Lisp_Object Qparent_id; 1056extern 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. */)
3392 "waitForWM", "WaitForWM", RES_TYPE_BOOLEAN); 3392 "waitForWM", "WaitForWM", RES_TYPE_BOOLEAN);
3393 x_default_parameter (f, parms, Qfullscreen, Qnil, 3393 x_default_parameter (f, parms, Qfullscreen, Qnil,
3394 "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); 3394 "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
3395 x_default_parameter (f, parms, Qtool_bar_position,
3396 f->tool_bar_position, 0, 0, RES_TYPE_SYMBOL);
3395 3397
3396 /* Compute the size of the X window. */ 3398 /* Compute the size of the X window. */
3397 window_prompting = x_figure_window_size (f, parms, 1); 3399 window_prompting = x_figure_window_size (f, parms, 1);