* net/tramp-cache.el (tramp-cache-inhibit-cache ): New defvar.
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 2 Aug 2009 17:15:42 +0000 (17:15 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 2 Aug 2009 17:15:42 +0000 (17:15 +0000)
(tramp-get-file-property): Use it.

lisp/net/tramp-cache.el

index 8a42a3f..49bbd79 100644 (file)
@@ -69,6 +69,9 @@
 (defvar tramp-cache-data (make-hash-table :test 'equal)
   "Hash table for remote files properties.")
 
+(defvar tramp-cache-inhibit-cache nil
+  "Inhibit cache read access, when non-nil.")
+
 (defcustom tramp-persistency-file-name
   (cond
    ;; GNU Emacs.
@@ -103,7 +106,7 @@ Returns DEFAULT if not set."
   (let* ((hash (or (gethash vec tramp-cache-data)
                   (puthash vec (make-hash-table :test 'equal)
                            tramp-cache-data)))
-        (value (if (hash-table-p hash)
+        (value (if (and (null tramp-cache-inhibit-cache) (hash-table-p hash))
                    (gethash property hash default)
                  default)))
     (tramp-message vec 8 "%s %s %s" file property value)
@@ -182,8 +185,8 @@ If the value is not set for the connection, returns DEFAULT."
     (aset key 3 nil))
   (let* ((hash (gethash key tramp-cache-data))
         (value (if (hash-table-p hash)
-                  (gethash property hash default)
-                default)))
+                   (gethash property hash default)
+                 default)))
     (tramp-message key 7 "%s %s" property value)
     value))