summaryrefslogtreecommitdiff
path: root/lisp/tool-bar.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2010-07-05 13:54:13 -0400
committerChong Yidong <cyd@stupidchicken.com>2010-07-05 13:54:13 -0400
commit4ad11f8ccbec3bda22e53f867e8ed7de0de1a085 (patch)
tree726800cb1c61402f1494cd51a89625f419b43d2f /lisp/tool-bar.el
parent81133808b8232266ce6244eae6b14ffc7dc92cbc (diff)
downloademacs-4ad11f8ccbec3bda22e53f867e8ed7de0de1a085.tar.gz
Set default-frame-alist, if necessary, in menu/tool-bar-mode.
* menu-bar.el (menu-bar-mode): * tool-bar.el (tool-bar-mode): Replace default-frame-alist element if it has been set.
Diffstat (limited to 'lisp/tool-bar.el')
-rw-r--r--lisp/tool-bar.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index eaa8551b019..4b83b07754d 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -52,13 +52,19 @@ conveniently adding tool bar items."
:global t
:group 'mouse
:group 'frames
- ;; Make tool-bar even if terminal is non-graphical (Bug#1754).
(let ((val (if tool-bar-mode 1 0)))
(dolist (frame (frame-list))
- (set-frame-parameter frame 'tool-bar-lines val)))
- (when tool-bar-mode
- (if (= 1 (length (default-value 'tool-bar-map))) ; not yet setup
- (tool-bar-setup))))
+ (set-frame-parameter frame 'tool-bar-lines val))
+ ;; If the user has given `default-frame-alist' a `tool-bar-lines'
+ ;; parameter, replace it.
+ (if (assq 'tool-bar-lines default-frame-alist)
+ (setq default-frame-alist
+ (cons (cons 'tool-bar-lines val)
+ (assq-delete-all 'tool-bar-lines
+ default-frame-alist)))))
+ (and tool-bar-mode
+ (= 1 (length (default-value 'tool-bar-map))) ; not yet setup
+ (tool-bar-setup)))
;;;###autoload
;; Used in the Show/Hide menu, to have the toggle reflect the current frame.