Function: projectile--watch-handle-stopped
projectile--watch-handle-stopped is a byte-compiled function defined
in projectile.el.
Signature
(projectile--watch-handle-stopped PROJECT DESCRIPTOR)
Documentation
Handle DESCRIPTOR's watch stopping in PROJECT.
When the watched directory is gone this is just the tail end of a deletion that the parent directory's watch already reported, so only the bookkeeping entry is dropped. When the directory still exists the watch died under us (backend hiccup, event queue overflow) and the cache can no longer be trusted, so throw to trigger invalidation. Always returns nil - the cached file list itself is not touched.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile--watch-handle-stopped (project descriptor)
"Handle DESCRIPTOR's watch stopping in PROJECT.
When the watched directory is gone this is just the tail end of a
deletion that the parent directory's watch already reported, so only
the bookkeeping entry is dropped. When the directory still exists the
watch died under us (backend hiccup, event queue overflow) and the
cache can no longer be trusted, so throw to trigger invalidation.
Always returns nil - the cached file list itself is not touched."
(let* ((watches (gethash project projectile--project-watches))
(entry (assoc descriptor watches)))
(when entry
(let ((remaining (delq entry watches)))
(if remaining
(puthash project remaining projectile--project-watches)
;; Never store nil - it would read as "not watched".
(remhash project projectile--project-watches)))
;; The root has no watched parent to report its deletion, so a stopped
;; root watch always invalidates, whether the directory survived or not.
(when (or (file-directory-p (cdr entry))
(string= (cdr entry)
(file-name-as-directory (expand-file-name project))))
(throw 'projectile--watch-fallback
(format "the watch on %s stopped unexpectedly" (cdr entry))))))
nil)