aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/tool-bar.el32
1 files changed, 19 insertions, 13 deletions
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index f0f2ff1f234..48ad887ddd1 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -93,20 +93,26 @@ Define this locally to override the global tool bar.")
93Its main job is to figure out which images to use based on the display's 93Its main job is to figure out which images to use based on the display's
94color capability and based on the available image libraries." 94color capability and based on the available image libraries."
95 (mapcar (lambda (bind) 95 (mapcar (lambda (bind)
96 (let (image-exp) 96 (let (image-exp plist)
97 (when (and (eq (car-safe (cdr-safe bind)) 'menu-item) 97 (when (and (eq (car-safe (cdr-safe bind)) 'menu-item)
98 (setq image-exp (plist-get bind :image)) 98 ;; For the format of menu-items, see node
99 (consp image-exp) 99 ;; `Extended Menu Items' in the Elisp manual.
100 (not (eq (car image-exp) 'image)) 100 (setq plist (nthcdr (if (consp (nth 4 bind)) 5 4)
101 (fboundp (car image-exp))) 101 bind))
102 (if (not (display-images-p)) 102 (setq image-exp (plist-get plist :image))
103 (setq bind nil) 103 (consp image-exp)
104 (let ((image (eval image-exp))) 104 (not (eq (car image-exp) 'image))
105 (unless (image-mask-p image) 105 (fboundp (car image-exp)))
106 (setq image (append image '(:mask heuristic)))) 106 (if (not (display-images-p))
107 (setq bind (copy-sequence bind)) 107 (setq bind nil)
108 (plist-put bind :image image)))) 108 (let ((image (eval image-exp)))
109 bind)) 109 (unless (image-mask-p image)
110 (setq image (append image '(:mask heuristic))))
111 (setq bind (copy-sequence bind)
112 plist (nthcdr (if (consp (nth 4 bind)) 5 4)
113 bind))
114 (plist-put plist :image image))))
115 bind))
110 tool-bar-map)) 116 tool-bar-map))
111 117
112(defconst tool-bar-find-image-cache (make-hash-table :weakness t :test 'equal)) 118(defconst tool-bar-find-image-cache (make-hash-table :weakness t :test 'equal))