Function: consult--global-mark-candidates

consult--global-mark-candidates is a byte-compiled function defined in consult.el.

Signature

(consult--global-mark-candidates MARKERS)

Documentation

Return list of candidates strings for MARKERS.

Source Code

;; Defined in ~/.emacs.d/elpa/consult-20260805.1130/consult.el
;;;;; Command: consult-global-mark

(defun consult--global-mark-candidates (markers)
  "Return list of candidates strings for MARKERS."
  (consult--forbid-minibuffer)
  (let ((candidates))
    (save-excursion
      (dolist (marker markers)
        (when-let* ((pos (marker-position marker))
                    (buf (marker-buffer marker))
                    ((not (minibufferp buf))))
          (with-current-buffer buf
            (when (consult--in-range-p pos)
              (goto-char pos)
              ;; `line-number-at-pos' is slow, see comment in `consult--mark-candidates'.
              (let* ((line (line-number-at-pos pos consult-line-numbers-widen))
                     (prefix (consult--format-file-line-match (buffer-name buf) line ""))
                     (cand (concat prefix (consult--line-with-mark marker) (consult--tofu-encode marker))))
                (put-text-property 0 (length prefix) 'consult-strip t cand)
                (put-text-property 0 (length cand) 'consult-location (cons marker line) cand)
                (push cand candidates)))))))
    (unless candidates
      (user-error "No global marks"))
    (nreverse (delete-dups candidates))))