From 4ad11f8ccbec3bda22e53f867e8ed7de0de1a085 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 5 Jul 2010 13:54:13 -0400 Subject: 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. --- lisp/tool-bar.el | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'lisp/tool-bar.el') 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. -- cgit v1.2.1