diff options
author | Gerd Moellmann <gerd@gnu.org> | 2000-11-27 11:28:24 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2000-11-27 11:28:24 +0000 |
commit | b6e6d31ec64e3f84c3f1574e746bac6189e79eeb (patch) | |
tree | c82e9204cf57862fd11304f30ff2bb799e930253 /lisp/toolbar | |
parent | e50ff726c9f1db85c8f352dd39893400b773d500 (diff) | |
download | emacs-b6e6d31ec64e3f84c3f1574e746bac6189e79eeb.tar.gz |
(tool-bar-add-item-from-menu): Handle case
that foreground and/or background colors of the face `tool-bar'
are unspecified.
Diffstat (limited to 'lisp/toolbar')
-rw-r--r-- | lisp/toolbar/tool-bar.el | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/lisp/toolbar/tool-bar.el b/lisp/toolbar/tool-bar.el index aea24df51e9..d26b0cab116 100644 --- a/lisp/toolbar/tool-bar.el +++ b/lisp/toolbar/tool-bar.el @@ -129,24 +129,25 @@ function." (setq map global-map)) (let* ((menu-bar-map (lookup-key map [menu-bar])) (keys (where-is-internal command menu-bar-map)) - (fg (face-foreground 'tool-bar)) - (bg (face-background 'tool-bar)) - (image (find-image - (if (display-color-p) - `((:type xpm :file ,(concat icon ".xpm")) - (:type pbm :file ,(concat icon ".pbm") - :background ,bg - :foreground ,fg) - (:type xbm :file ,(concat icon ".xbm") - :background ,bg - :foreground ,fg)) - `((:type pbm :file ,(concat icon ".pbm") - :background ,bg - :foreground ,fg) - (:type xbm :file ,(concat icon ".xbm") - :background ,bg - :foreground ,fg) - (:type xpm :file ,(concat icon ".xpm")))))) + (fg (if (eq (face-foreground 'tool-bar) 'unspecified) + nil + (list :foreground (face-foreground 'tool-bar)))) + (bg (if (eq (face-background 'tool-bar) 'unspecified) + nil + (list :background (face-background 'tool-bar)))) + (colors (nconc fg bg)) + (spec (if (display-color-p) + (list (list :type 'xpm :file (concat icon ".xpm")) + (append (list :type 'pbm :file (concat icon ".pbm")) + colors) + (append (list :type 'xbm :file (concat icon ".xbm")) + colors)) + (list (append (list :type 'pbm :file (concat icon ".pbm")) + colors) + (append (list :type 'xbm :file (concat icon ".xbm")) + colors) + (list :type 'xpm :file (concat icon ".xpm"))))) + (image (find-image spec)) submap key) (when image ;; We'll pick up the last valid entry in the list of keys if |