Function: tempel--annotate

tempel--annotate is a natively compiled function defined in tempel.el.

Signature

(tempel--annotate TEMPLATES WIDTH SEP NAME)

Documentation

Annotate template NAME given the list of TEMPLATES.

WIDTH and SEP configure the formatting.

Source Code

;; Defined in /nix/store/b3ibjbs2i12kyhwapibfx6i39f025i85-emacs-packages-deps/share/emacs/site-lisp/elpa/tempel-20260705.1258/tempel.el
(defun tempel--annotate (templates width sep name)
  "Annotate template NAME given the list of TEMPLATES.
WIDTH and SEP configure the formatting."
  (when-let* ((name (intern-soft name))
              (template (alist-get name templates)))
    (let ((ann (truncate-string-to-width
                (string-trim
                 (replace-regexp-in-string
                  "[ \t\n\r]+" " "
                  (or (plist-get (tempel--template-plist template) :ann)
                      (tempel--print-template template))))
                width)))
      (add-face-text-property 0 (length ann) 'completions-annotations t ann)
      (concat sep ann))))