Function: projectile-replace--gather-async

projectile-replace--gather-async is a byte-compiled function defined in projectile.el.

Signature

(projectile-replace--gather-async CANDIDATES REGEXP BUFFER ON-DONE)

Documentation

Scan CANDIDATES for REGEXP into BUFFER incrementally, then call ON-DONE.

Resets BUFFER's match list and scanning state, then processes CANDIDATES in projectile-search-scan-chunk-size batches, each batch delivering its matches and re-rendering before yielding to redisplay via a zero-delay timer. Matches accumulate in file order, so the final list is identical to projectile-replace--gather over the same CANDIDATES and REGEXP; projectile-search-max-matches and the :truncated note are honored the same way. ON-DONE (or nil) is called in BUFFER once the scan finishes. A scan already running in BUFFER should be canceled first (see projectile-replace--cancel-scan).

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-replace--gather-async (candidates regexp buffer on-done)
  "Scan CANDIDATES for REGEXP into BUFFER incrementally, then call ON-DONE.
Resets BUFFER's match list and scanning state, then processes CANDIDATES
in `projectile-search-scan-chunk-size' batches, each batch delivering
its matches and re-rendering before yielding to redisplay via a
zero-delay timer.  Matches accumulate in file order, so the final list is
identical to `projectile-replace--gather' over the same CANDIDATES and
REGEXP; `projectile-search-max-matches' and the `:truncated' note are
honored the same way.  ON-DONE (or nil) is called in BUFFER once the scan
finishes.  A scan already running in BUFFER should be canceled first (see
`projectile-replace--cancel-scan')."
  (let ((generation
         (with-current-buffer buffer
           (setq projectile-replace--matches nil
                 projectile-replace--truncated nil
                 projectile-replace--filtered nil
                 projectile-replace--scanning t
                 projectile-replace--scan-timer nil)
           (cl-incf projectile-replace--scan-generation))))
    (projectile-replace--scan-step
     buffer candidates regexp projectile-search-max-matches on-done generation)))