Function: marginalia-annotate-bookmark

marginalia-annotate-bookmark is a byte-compiled function defined in marginalia.el.

Signature

(marginalia-annotate-bookmark CAND)

Documentation

Annotate bookmark CAND with its file name and front context string.

Source Code

;; Defined in ~/.emacs.d/elpa/marginalia-20260724.810/marginalia.el
(defun marginalia-annotate-bookmark (cand)
  "Annotate bookmark CAND with its file name and front context string."
  (when-let* ((bm (assoc cand (bound-and-true-p bookmark-alist))))
    (marginalia--fields
     ((marginalia--bookmark-type bm) :width 10 :face 'marginalia-type)
     ((or (bookmark-prop-get bm 'filename)
          (bookmark-prop-get bm 'location))
      :truncate (if (bookmark-prop-get bm 'filename) -0.5 0.5)
      :face 'marginalia-file-name)
     ((let ((front (or (bookmark-prop-get bm 'front-context-string) ""))
            (rear (or (bookmark-prop-get bm 'rear-context-string) "")))
        (unless (and (string-blank-p front) (string-blank-p rear))
          (string-clean-whitespace
           (concat front (marginalia--ellipsis) rear))))
      :truncate 0.5 :face 'marginalia-documentation))))