Function: treemacs-map-icons-with-auto-mode-alist

treemacs-map-icons-with-auto-mode-alist is an autoloaded and byte-compiled function defined in treemacs-icons.el.

Signature

(treemacs-map-icons-with-auto-mode-alist EXTENSIONS MODE-ICON-ALIST)

Documentation

Remaps icons for EXTENSIONS according to auto-mode-alist.

EXTENSIONS should be a list of file extensions such that they match the regex stored in auto-mode-alist, for example '(".cc"). MODE-ICON-ALIST is an alist that maps which mode from auto-mode-alist should be assigned which treemacs icon, for example
`((c-mode . ,(treemacs-get-icon-value "c"))
  (c++-mode . ,(treemacs-get-icon-value "cpp")))

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-icons.el
;;;###autoload
(defun treemacs-map-icons-with-auto-mode-alist (extensions mode-icon-alist)
  "Remaps icons for EXTENSIONS according to `auto-mode-alist'.
EXTENSIONS should be a list of file extensions such that they match the regex
stored in `auto-mode-alist', for example \\='(\".cc\").
MODE-ICON-ALIST is an alist that maps which mode from `auto-mode-alist' should
be assigned which treemacs icon, for example
`((c-mode . ,(treemacs-get-icon-value \"c\"))
  (c++-mode . ,(treemacs-get-icon-value \"cpp\")))"
  (dolist (extension extensions)
    (-when-let* ((mode (cdr (--first (s-matches? (car it) extension) auto-mode-alist)))
                 (icon (cdr (assq mode mode-icon-alist))))
      (ht-set! (treemacs-theme->gui-icons treemacs--current-theme)
               (substring extension 1)
               icon))))