The images are XPM located in a directory such as .../Emacs.app/Contents/Resources/etc/images/ezimage
[Location example is for Emacs built --with-ns
.] This answer contemplates changing the current XPM images with different XPM images. It is certainly possible to rewrite the speedbar.el
library and related libraries to insert PNG images (a time-consuming undertaking), but that is beyond the scope of this XPM answer.
The XPM images can be customized by modifying the values in the variable speedbar-expand-image-button-alist
and by adding additional XPM images to the default location. The default values are as follows:
'(("<+>" . ezimage-directory-plus)
("<->" . ezimage-directory-minus)
("< >" . ezimage-directory)
("[+]" . ezimage-page-plus)
("[-]" . ezimage-page-minus)
("[?]" . ezimage-page)
("[ ]" . ezimage-page)
("{+}" . ezimage-box-plus)
("{-}" . ezimage-box-minus)
("<M>" . ezimage-mail)
("<d>" . ezimage-document-tag)
("<i>" . ezimage-info-tag)
(" =>" . ezimage-tag)
(" +>" . ezimage-tag-gt)
(" ->" . ezimage-tag-v)
(">" . ezimage-tag)
("@" . ezimage-tag-type)
(" @" . ezimage-tag-type)
("*" . ezimage-checkout)
("#" . ezimage-object)
("!" . ezimage-object-out-of-date)
("//" . ezimage-label)
("%" . ezimage-lock)
)
For example, let us assume that we want to change the directory plus/minus images for the box plus/minus images, and visa versa:
(setq speedbar-expand-image-button-alist
'(("<+>" . ezimage-box-plus) ;; previously ezimage-directory-plus
("<->" . ezimage-box-minus) ;; previously ezimage-directory-minus
("< >" . ezimage-directory)
("[+]" . ezimage-page-plus)
("[-]" . ezimage-page-minus)
("[?]" . ezimage-page)
("[ ]" . ezimage-page)
("{+}" . ezimage-directory-plus) ;; previously ezimage-box-plus
("{-}" . ezimage-directory-minus) ;; previously ezimage-box-minus
("<M>" . ezimage-mail)
("<d>" . ezimage-document-tag)
("<i>" . ezimage-info-tag)
(" =>" . ezimage-tag)
(" +>" . ezimage-tag-gt)
(" ->" . ezimage-tag-v)
(">" . ezimage-tag)
("@" . ezimage-tag-type)
(" @" . ezimage-tag-type)
("*" . ezimage-checkout)
("#" . ezimage-object)
("!" . ezimage-object-out-of-date)
("//" . ezimage-label)
("%" . ezimage-lock)
))