# HG changeset patch # User Dave Love # Date 971170264 0 # Node ID 52dcf5ad617680bb186fe615ce51518d4934a513 # Parent e8a33eb0e2b478b4bda567f3f13b284372597109 (tool-bar-add-item) (tool-bar-add-item-from-menu): Don't favour XPM icons on mono display. diff -r e8a33eb0e2b4 -r 52dcf5ad6176 lisp/toolbar/tool-bar.el --- a/lisp/toolbar/tool-bar.el Tue Oct 10 02:48:40 2000 +0000 +++ b/lisp/toolbar/tool-bar.el Tue Oct 10 09:31:04 2000 +0000 @@ -90,9 +90,14 @@ Keybindings are made in the map `tool-bar-map'. To define items in some local map, bind `tool-bar-map' with `let' around calls of this function." - (let ((image (find-image `((:type xpm :file ,(concat icon ".xpm")) - (:type pbm :file ,(concat icon ".pbm")) - (:type xbm :file ,(concat icon ".xbm")))))) + (let ((image (find-image + (if (display-color-p) + `((:type xpm :file ,(concat icon ".xpm")) + (:type pbm :file ,(concat icon ".pbm")) + (:type xbm :file ,(concat icon ".xbm"))) + `((:type pbm :file ,(concat icon ".pbm")) + (:type xbm :file ,(concat icon ".xbm")) + (:type xpm :file ,(concat icon ".xpm"))))))) (when image (unless (image-mask-p image) (setq image (append image '(:mask heuristic)))) @@ -115,9 +120,14 @@ (setq map global-map)) (let* ((menu-bar-map (lookup-key map [menu-bar])) (keys (where-is-internal command menu-bar-map)) - (image (find-image `((:type xpm :file ,(concat icon ".xpm")) - (:type pbm :file ,(concat icon ".pbm")) - (:type xbm :file ,(concat icon ".xbm"))))) + (image (find-image + (if (display-color-p) + `((:type xpm :file ,(concat icon ".xpm")) + (:type pbm :file ,(concat icon ".pbm")) + (:type xbm :file ,(concat icon ".xbm"))) + `((:type pbm :file ,(concat icon ".pbm")) + (:type xbm :file ,(concat icon ".xbm")) + (:type xpm :file ,(concat icon ".xpm")))))) submap key) (when image ;; We'll pick up the last valid entry in the list of keys if