Function: consult--grep-position
consult--grep-position is a natively compiled function defined in
consult.el.
Signature
(consult--grep-position CAND &optional FIND-FILE)
Documentation
Return the grep position marker for CAND.
FIND-FILE is the file open function, defaulting to find-file-noselect.
Source Code
;; Defined in /nix/store/6higv2v1wk916v4ynnybyrdkfy2gq44d-emacs-packages-deps/share/emacs/site-lisp/elpa/consult-20261004.957/consult.el
(defun consult--grep-position (cand &optional find-file)
"Return the grep position marker for CAND.
FIND-FILE is the file open function, defaulting to `find-file-noselect'."
(when cand
(let* ((file-end (next-single-property-change 0 'face cand))
(line-end (next-single-property-change (1+ file-end) 'face cand))
(matches (consult--point-placement cand (1+ line-end) 'consult-grep-context))
(file (substring-no-properties cand 0 file-end))
(line (string-to-number (substring-no-properties cand (+ 1 file-end) line-end))))
(when-let* ((pos (consult--marker-from-line-column
(funcall (or find-file #'consult--file-action) file)
line (or (car matches) 0))))
(cons pos (cdr matches))))))