[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/buffer-env d3485947ff 3/5: Add a simple check to detect
From: |
ELPA Syncer |
Subject: |
[elpa] externals/buffer-env d3485947ff 3/5: Add a simple check to detect outdated cache entries |
Date: |
Mon, 6 Jun 2022 06:57:20 -0400 (EDT) |
branch: externals/buffer-env
commit d3485947ff1d172841edf04e31a9b6c1f84ff231
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Augusto Stoffel <astoff@users.noreply.github.com>
Add a simple check to detect outdated cache entries
---
buffer-env.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/buffer-env.el b/buffer-env.el
index 710a482c15..5e752da7d0 100644
--- a/buffer-env.el
+++ b/buffer-env.el
@@ -185,7 +185,11 @@ When called interactively, ask for a FILE."
(attr (file-attributes file))
(modtime (file-attribute-modification-time attr)))
(if-let* ((cache (assoc file buffer-env-cache-alist #'file-equal-p))
- ((not (time-less-p (nth 1 cache) modtime))))
+ ((not (time-less-p (nth 1 cache) modtime)))
+ ;; Simple test to check if a dynamic environment
+ ;; generated by a functional package manager has
+ ;; disappeared, in which case the cache is invalidated.
+ ((seq-every-p #'file-exists-p (nth 3 cache))))
(progn
(setq-local process-environment (nth 2 cache)
exec-path (nth 3 cache))