From: Glenn Morris Date: Thu, 20 Jul 2017 17:46:52 +0000 (-0400) Subject: Make tramp unloading handle debug counter variables X-Git-Tag: emacs-26.0.90~518^2~50 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ee5ec64624b72fb5c18945949437c6371c76d14c;p=emacs.git 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. --- diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index ac5a9c45bbd..7227c9bf7cc 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))