Function: projectile-replace--cancel-scan
projectile-replace--cancel-scan is a byte-compiled function defined in
projectile.el.
Signature
(projectile-replace--cancel-scan)
Documentation
Cancel any in-flight async scan in the current results buffer.
Kills the pending chunk timer (if any) and clears the scanning flag, so
no timer is left dangling. Safe to call when nothing is scanning; used
on re-scan, on quit, and from kill-buffer-hook.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-replace--cancel-scan ()
"Cancel any in-flight async scan in the current results buffer.
Kills the pending chunk timer (if any) and clears the scanning flag, so
no timer is left dangling. Safe to call when nothing is scanning; used
on re-scan, on quit, and from `kill-buffer-hook'."
(when projectile-replace--scan-timer
(cancel-timer projectile-replace--scan-timer))
(when (process-live-p projectile-replace--scan-process)
;; drop our sentinel first so killing it doesn't run the finish handler
(set-process-sentinel projectile-replace--scan-process #'ignore)
(delete-process projectile-replace--scan-process))
;; Bump the generation so a chunk timer that already fired and is queued
;; behind us no-ops rather than resurrecting this scan.
(cl-incf projectile-replace--scan-generation)
(setq projectile-replace--scan-timer nil
projectile-replace--scan-process nil
projectile-replace--scanning nil))