Function: consult--line-multi-candidates
consult--line-multi-candidates is a byte-compiled function defined in
consult.el.
Signature
(consult--line-multi-candidates BUFFERS INPUT CALLBACK)
Documentation
Collect matching candidates from multiple buffers.
INPUT is the user input which should be matched. BUFFERS is the list of buffers. CALLBACK receives the candidates.
Source Code
;; Defined in ~/.emacs.d/elpa/consult-20260805.1130/consult.el
(defun consult--line-multi-candidates (buffers input callback)
"Collect matching candidates from multiple buffers.
INPUT is the user input which should be matched.
BUFFERS is the list of buffers.
CALLBACK receives the candidates."
(pcase-let ((`(,regexps . ,hl) (consult--compile-regexp input 'emacs completion-ignore-case))
(candidates nil)
(cand-idx 0))
(when regexps
(dolist (buf buffers)
(with-current-buffer buf
(save-excursion
(let ((line (line-number-at-pos (point-min) consult-line-numbers-widen)))
(goto-char (point-min))
(while (and (not (eobp))
(save-excursion (re-search-forward (car regexps) nil t)))
(incf line (consult--count-lines (match-beginning 0)))
(let ((bol (pos-bol))
(eol (pos-eol)))
(goto-char bol)
(when (and (not (looking-at-p "^\\s-*$"))
(cl-loop for r in (cdr regexps) always
(progn
(goto-char bol)
(re-search-forward r eol t))))
(push (consult--location-candidate
(funcall hl (buffer-substring-no-properties bol eol))
(cons buf bol) (1- line) cand-idx)
candidates)
(incf cand-idx))
(goto-char (1+ eol)))))))
(funcall callback (nreverse candidates))
(setq candidates nil)))))