]> code.delx.au - gnu-emacs/blobdiff - lisp/tool-bar.el
Fixes: debbugs:6594
[gnu-emacs] / lisp / tool-bar.el
index a08df3124a869494a0ce3740236285337fc2481e..ddaf16043a30058ab5174e3e3135b6675c5e239a 100644 (file)
@@ -1,7 +1,7 @@
 ;;; tool-bar.el --- setting up the tool bar
 ;;
 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 ;;
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: mouse frames
@@ -54,9 +54,12 @@ conveniently adding tool bar items."
   :group 'frames
   (if tool-bar-mode
       (progn
-       (dolist (frame (frame-list))
-         (if (display-graphic-p frame)
-             (set-frame-parameter frame 'tool-bar-lines 1)))
+       ;; Make one tool-bar-line for any - including non-graphical -
+       ;; terminal, see Bug#1754.  If this causes problems, we should
+       ;; handle the problem in `modify-frame-parameters' or do not
+       ;; call `modify-all-frames-parameters' when toggling the tool
+       ;; bar off either.
+       (modify-all-frames-parameters (list (cons 'tool-bar-lines 1)))
        (if (= 1 (length (default-value 'tool-bar-map))) ; not yet setup
            (tool-bar-setup)))
     (modify-all-frames-parameters (list (cons 'tool-bar-lines 0)))))
@@ -87,7 +90,7 @@ See `tool-bar-mode' for more information."
 Define this locally to override the global tool bar.")
 
 (global-set-key [tool-bar]
-               '(menu-item "tool bar" ignore
+               `(menu-item ,(purecopy "tool bar") ignore
                            :filter tool-bar-make-keymap))
 
 (declare-function image-mask-p "image.c" (spec &optional frame))