branch: elpa/projectile
commit 844129c080a01f6807ec9ca2acd415b5f196bef1
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Fix projectile-purge-file-from-cache serializing stale data
The function was serializing the original file list to disk instead of
the updated list with the file removed. This meant purged files would
reappear in the cache after restarting Emacs.
---
projectile.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/projectile.el b/projectile.el
index f6b7e6356a..bbcddcfa60 100644
--- a/projectile.el
+++ b/projectile.el
@@ -1159,10 +1159,10 @@ The cache is created both in memory and on the hard
drive."
(let* ((project-root (projectile-project-root))
(project-cache (gethash project-root projectile-projects-cache)))
(if (projectile-file-cached-p file project-root)
- (progn
- (puthash project-root (remove file project-cache)
projectile-projects-cache)
+ (let ((new-cache (remove file project-cache)))
+ (puthash project-root new-cache projectile-projects-cache)
(when (projectile-persistent-cache-p)
- (projectile-serialize project-cache (projectile-project-cache-file
project-root)))
+ (projectile-serialize new-cache (projectile-project-cache-file
project-root)))
(when projectile-verbose
(message "%s removed from cache" file)))
(error "%s is not in the cache" file))))