diff options
| author | Gerd Moellmann | 2000-11-27 11:28:24 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-11-27 11:28:24 +0000 |
| commit | 7e6369044dc68e1e217e7fd6a7adda3cebe2f57e (patch) | |
| tree | 40de0ca267b9d3489175eac3b3fce10c89bebfc3 | |
| parent | ec7251660f25010ae772a337cc0fbdcd3d7b6595 (diff) | |
| download | emacs-7e6369044dc68e1e217e7fd6a7adda3cebe2f57e.tar.gz emacs-7e6369044dc68e1e217e7fd6a7adda3cebe2f57e.zip | |
(tool-bar-add-item-from-menu): Handle case
that foreground and/or background colors of the face `tool-bar'
are unspecified.
| -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." | |||
| 129 | (setq map global-map)) | 129 | (setq map global-map)) |
| 130 | (let* ((menu-bar-map (lookup-key map [menu-bar])) | 130 | (let* ((menu-bar-map (lookup-key map [menu-bar])) |
| 131 | (keys (where-is-internal command menu-bar-map)) | 131 | (keys (where-is-internal command menu-bar-map)) |
| 132 | (fg (face-foreground 'tool-bar)) | 132 | (fg (if (eq (face-foreground 'tool-bar) 'unspecified) |
| 133 | (bg (face-background 'tool-bar)) | 133 | nil |
| 134 | (image (find-image | 134 | (list :foreground (face-foreground 'tool-bar)))) |
| 135 | (if (display-color-p) | 135 | (bg (if (eq (face-background 'tool-bar) 'unspecified) |
| 136 | `((:type xpm :file ,(concat icon ".xpm")) | 136 | nil |
| 137 | (:type pbm :file ,(concat icon ".pbm") | 137 | (list :background (face-background 'tool-bar)))) |
| 138 | :background ,bg | 138 | (colors (nconc fg bg)) |
| 139 | :foreground ,fg) | 139 | (spec (if (display-color-p) |
| 140 | (:type xbm :file ,(concat icon ".xbm") | 140 | (list (list :type 'xpm :file (concat icon ".xpm")) |
| 141 | :background ,bg | 141 | (append (list :type 'pbm :file (concat icon ".pbm")) |
| 142 | :foreground ,fg)) | 142 | colors) |
| 143 | `((:type pbm :file ,(concat icon ".pbm") | 143 | (append (list :type 'xbm :file (concat icon ".xbm")) |
| 144 | :background ,bg | 144 | colors)) |
| 145 | :foreground ,fg) | 145 | (list (append (list :type 'pbm :file (concat icon ".pbm")) |
| 146 | (:type xbm :file ,(concat icon ".xbm") | 146 | colors) |
| 147 | :background ,bg | 147 | (append (list :type 'xbm :file (concat icon ".xbm")) |
| 148 | :foreground ,fg) | 148 | colors) |
| 149 | (:type xpm :file ,(concat icon ".xpm")))))) | 149 | (list :type 'xpm :file (concat icon ".xpm"))))) |
| 150 | (image (find-image spec)) | ||
| 150 | submap key) | 151 | submap key) |
| 151 | (when image | 152 | (when image |
| 152 | ;; We'll pick up the last valid entry in the list of keys if | 153 | ;; We'll pick up the last valid entry in the list of keys if |