Function: projectile-purge-dir-from-cache

projectile-purge-dir-from-cache is an autoloaded, interactive and byte-compiled function defined in projectile.el.

Signature

(projectile-purge-dir-from-cache DIR)

Documentation

Purge DIR from the cache of the current project.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
;;;###autoload
(defun projectile-purge-dir-from-cache (dir)
  "Purge DIR from the cache of the current project."
  (interactive
   (list (projectile-completing-read
          "Remove directory from cache: "
          (projectile-current-project-dirs)
          :caller 'projectile-read-directory)))
  (let* ((project-root (projectile-project-root))
         (project-cache (gethash project-root projectile-projects-cache))
         (new-cache (seq-remove (lambda (str) (string-prefix-p dir str))
                                project-cache)))
    (puthash project-root new-cache projectile-projects-cache)
    (when (projectile-persistent-cache-p)
      (projectile-serialize new-cache (projectile-project-cache-file project-root)))
    ;; Re-derive watches so the purged directory is no longer watched (and its
    ;; files don't get re-added by a later create-event).
    (projectile--maybe-watch-project project-root new-cache)))