summaryrefslogtreecommitdiff
path: root/tramp-cache.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2026-04-29 08:51:08 +0200
committerMichael Albinus <michael.albinus@gmx.de>2026-04-29 08:51:08 +0200
commit16c625636811ab7b78ea238d063f0c7940196ddd (patch)
tree8084eb9daf22b5173c87dd75b572f27d17c5bb0b /tramp-cache.el
parentfe4488160a4c40c0540b31997b95764571a9202f (diff)
Tramp ELPA version 2.8.1.4 releasedexternals/tramp
Diffstat (limited to 'tramp-cache.el')
-rw-r--r--tramp-cache.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/tramp-cache.el b/tramp-cache.el
index 1fc3fb3..b47a2aa 100644
--- a/tramp-cache.el
+++ b/tramp-cache.el
@@ -161,6 +161,20 @@ If KEY is `tramp-cache-undefined', don't create anything, and return nil."
;; would fail.
(function-put #'tramp-get-hash-table 'tramp-suppress-trace t)
+(defsubst tramp-suppress-remote-file-name-inhibit-cache ()
+ "Weaken `remote-file-name-inhibit-cache'.
+This is meant to be let-bound for code over many cache operations, like
+in large directories."
+ ;; If `remote-file-name-inhibit-cache' is already `nil', keep it.
+ (cond
+ (;; A timestamp. Keep it.
+ (consp remote-file-name-inhibit-cache) remote-file-name-inhibit-cache)
+ (;; A number of seconds. Set a timestamp with the difference.
+ (numberp remote-file-name-inhibit-cache)
+ (time-subtract nil remote-file-name-inhibit-cache))
+ (;; Cache is disabled. Set a timestamp from now on.
+ t (current-time))))
+
;;;###tramp-autoload
(defun tramp-get-file-property (key file property &optional default)
"Get the PROPERTY of FILE from the cache context of KEY.