emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master ee5ec64: Make tramp unloading handle debug counter


From: Glenn Morris
Subject: [Emacs-diffs] master ee5ec64: Make tramp unloading handle debug counter variables
Date: Thu, 20 Jul 2017 13:47:03 -0400 (EDT)

branch: master
commit ee5ec64624b72fb5c18945949437c6371c76d14c
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    Make tramp unloading handle debug counter variables
    
    * lisp/net/tramp-cache.el (tramp-get-file-property)
    (tramp-set-file-property): Add counter variables to tramp-unload-hook.
---
 lisp/net/tramp-cache.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index ac5a9c4..7227c9b 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -136,7 +136,11 @@ Returns DEFAULT if not set."
     (tramp-message key 8 "%s %s %s" file property value)
     (when (>= tramp-verbose 10)
       (let* ((var (intern (concat "tramp-cache-get-count-" property)))
-            (val (or (and (boundp var) (symbol-value var)) 0)))
+            (val (or (and (boundp var) (symbol-value var))
+                     (progn
+                       (add-hook 'tramp-unload-hook
+                                 (lambda () (makunbound var)))
+                       0))))
        (set var (1+ val))))
     value))
 
@@ -156,7 +160,11 @@ Returns VALUE."
     (tramp-message key 8 "%s %s %s" file property value)
     (when (>= tramp-verbose 10)
       (let* ((var (intern (concat "tramp-cache-set-count-" property)))
-            (val (or (and (boundp var) (symbol-value var)) 0)))
+            (val (or (and (boundp var) (symbol-value var))
+                     (progn
+                       (add-hook 'tramp-unload-hook
+                                 (lambda () (makunbound var)))
+                       0))))
        (set var (1+ val))))
     value))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]