Function: treemacs-define-custom-icon

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

Signature

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

Documentation

Define a custom ICON for the current theme to use for FILE-EXTENSIONS.

Note that treemacs has a very loose definition of what constitutes a file extension - it's either everything past the last period, or just the file's full name if there is no period. This makes it possible to match file names like
'.gitignore' and 'Makefile'.

Additionally FILE-EXTENSIONS are also not case sensitive and will be stored in a down-cased state.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-icons.el
;;;###autoload
(defun treemacs-define-custom-icon (icon &rest file-extensions)
  "Define a custom ICON for the current theme to use for FILE-EXTENSIONS.

Note that treemacs has a very loose definition of what constitutes a file
extension - it's either everything past the last period, or just the file's full
name if there is no period.  This makes it possible to match file names like
\\='.gitignore' and \\='Makefile'.

Additionally FILE-EXTENSIONS are also not case sensitive and will be stored in a
down-cased state."
  (unless icon
    (user-error "Custom icon cannot be nil"))
  (dolist (ext file-extensions)
    (ht-set! (treemacs-theme->gui-icons treemacs--current-theme)
             (downcase ext)
             (concat icon " "))))