summaryrefslogtreecommitdiff
path: root/lisp/tool-bar.el
diff options
context:
space:
mode:
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.