Function: treemacs-define-custom-image-icon

treemacs-define-custom-image-icon is an autoloaded and byte-compiled function defined in treemacs-icons.el.

Signature

(treemacs-define-custom-image-icon FILE &rest FILE-EXTENSIONS)

Documentation

Same as treemacs-define-custom-icon but for image icons instead of strings.

FILE is the path to an icon image (and not the actual icon string). FILE-EXTENSIONS are all the (not case-sensitive) file extensions the icon should be used for.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-icons.el
;;;###autoload
(defun treemacs-define-custom-image-icon (file &rest file-extensions)
  "Same as `treemacs-define-custom-icon' but for image icons instead of strings.
FILE is the path to an icon image (and not the actual icon string).
FILE-EXTENSIONS are all the (not case-sensitive) file extensions the icon
should be used for."
  (unless file
    (user-error "Custom icon cannot be nil"))
  (-let [icon (car (treemacs--create-icon-strings file " "))]
    (dolist (ext file-extensions)
      (ht-set! (treemacs-theme->gui-icons treemacs--current-theme)
               (downcase ext)
               icon))))