Function: treemacs-set-annotation-suffix
treemacs-set-annotation-suffix is a byte-compiled function defined in
treemacs-annotations.el.
Signature
(treemacs-set-annotation-suffix PATH SUFFIX SOURCE)
Documentation
Annotate PATH with the given SUFFIX.
Will save the SUFFIX as coming from SOURCE so it can be combined with suffixes coming from other sources.
Source must be a *string* so that multiple suffix annotations on the same node can be sorted to always appear in the same order, regardless of when they were added.
Treemacs does not prescribe using a specific face for suffix annotations, users of this api can propertize suffixes as they see fit.
PATH: Node Path SUFFIX: String SOURCE: String
Source Code
;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-annotations.el
;; Suffixes
(define-inline treemacs-set-annotation-suffix (path suffix source)
"Annotate PATH with the given SUFFIX.
Will save the SUFFIX as coming from SOURCE so it can be combined with suffixes
coming from other sources.
Source must be a *string* so that multiple suffix annotations on the same node
can be sorted to always appear in the same order, regardless of when they were
added.
Treemacs does not prescribe using a specific face for suffix annotations, users
of this api can propertize suffixes as they see fit.
PATH: Node Path
SUFFIX: String
SOURCE: String"
(inline-letevals (source path suffix)
(inline-quote
(progn
(put-text-property 0 (length ,suffix) 'treemacs-suffix-annotation t ,suffix)
(-if-let (ann (treemacs-get-annotation ,path))
(let* ((suffix-list (treemacs-annotation->suffix ann))
(old-suffix (--first (string= ,source (car it)) suffix-list)))
(if old-suffix
(setcdr old-suffix ,suffix)
(setf (treemacs-annotation->suffix ann)
(--sort (string< (car it) (car other))
(cons (cons ,source ,suffix) suffix-list))))
(setf (treemacs-annotation->suffix-value ann)
(mapconcat #'identity (mapcar #'cdr (treemacs-annotation->suffix ann)) " ")))
(ht-set! treemacs--annotation-store ,path
(treemacs-annotation->create!
:suffix (list (cons ,source ,suffix))
:suffix-value ,suffix)))))))