Function: consult-line-multi
consult-line-multi is an autoloaded, interactive and byte-compiled
function defined in consult.el.
Signature
(consult-line-multi QUERY &optional INITIAL)
Documentation
Search for a matching line in multiple buffers.
By default search across all project buffers. If the prefix
argument QUERY is non-nil, all buffers are searched. Optional
INITIAL input can be provided. The symbol at point and the last
isearch-string is added to the future history. In order to
search a subset of buffers, QUERY can be set to a plist according
to consult--buffer-query.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/consult-20260805.1130/consult.el
;;;###autoload
(defun consult-line-multi (query &optional initial)
"Search for a matching line in multiple buffers.
By default search across all project buffers. If the prefix
argument QUERY is non-nil, all buffers are searched. Optional
INITIAL input can be provided. The symbol at point and the last
`isearch-string' is added to the future history. In order to
search a subset of buffers, QUERY can be set to a plist according
to `consult--buffer-query'."
(interactive "P")
(unless (keywordp (car-safe query))
(setq query (list :sort 'alpha-current :directory (and (not query) 'project))))
(pcase-let* ((`(,prompt . ,buffers) (consult--buffer-query-prompt "Go to line" query))
(collection (consult--dynamic-collection
(apply-partially #'consult--line-multi-candidates
buffers))))
(consult--read
collection
:prompt prompt
:annotate (consult--line-fontify)
:category 'consult-location
:sort nil
:require-match t
;; Always add last Isearch string to future history
:add-history (delq nil (list (thing-at-point 'symbol) isearch-string))
:history '(:input consult--line-multi-history)
:lookup #'consult--line-multi-match
;; Add `isearch-string' as initial input if starting from Isearch
:initial (or initial
(and isearch-mode
(prog1 isearch-string (isearch-done))))
:state (consult--location-state (lambda () (funcall collection nil)))
:group #'consult--line-multi-group)))