Function: treemacs-set-annotation-face

treemacs-set-annotation-face is a byte-compiled function defined in treemacs-annotations.el.

Signature

(treemacs-set-annotation-face PATH FACE SOURCE)

Documentation

Annotate PATH with the given FACE.

Will save the FACE as coming from SOURCE so it can be combined with faces coming from other sources.

Source must be a *string* so that multiple face annotations on the same node can be sorted to always be applied in the same order, regardless of when they were added.

PATH: Node Path FACE: Face SOURCE: String

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-annotations.el
;;; Faces

(define-inline treemacs-set-annotation-face (path face source)
  "Annotate PATH with the given FACE.

Will save the FACE as coming from SOURCE so it can be combined with faces coming
from other sources.

Source must be a *string* so that multiple face annotations on the same node can
be sorted to always be applied in the same order, regardless of when they were
added.

PATH: Node Path
FACE: Face
SOURCE: String"
  (inline-letevals (source path face)
    (inline-quote
     (-if-let* ((ann (treemacs-get-annotation ,path)))
         (let* ((face-list (treemacs-annotation->face ann))
                (old-face (--first (string= ,source (car it)) face-list)))
           (if old-face
               (setcdr old-face ,face)
             (setf (treemacs-annotation->face ann)
                   (--sort (string< (car it) (car other))
                           (cons (cons ,source ,face) face-list))))
           (setf (treemacs-annotation->face-value ann)
                 (append (mapcar #'cdr (treemacs-annotation->face ann))
                         (treemacs-annotation->git-face ann))))
       (ht-set! treemacs--annotation-store ,path
                (treemacs-annotation->create!
                 :face (list (cons ,source ,face))
                 :face-value (list ,face)))))))