From 290d0e733f15135696365be79285bceaaa2067f2 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 20 Jul 2017 20:27:55 +0200 Subject: [PATCH] Stylistic changes in tramp-cache.el * test/lisp/net/tramp-cache.el (tramp-get-file-property) (tramp-set-file-property): Use `bound-and-true-p'. Add counter variables to `tramp-cache-unload-hook'. --- lisp/net/tramp-cache.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 7227c9bf7cc..a162ab00a56 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -136,9 +136,9 @@ 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)) + (val (or (bound-and-true-p var) (progn - (add-hook 'tramp-unload-hook + (add-hook 'tramp-cache-unload-hook (lambda () (makunbound var))) 0)))) (set var (1+ val)))) @@ -160,9 +160,9 @@ 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)) + (val (or (bound-and-true-p var) (progn - (add-hook 'tramp-unload-hook + (add-hook 'tramp-cache-unload-hook (lambda () (makunbound var))) 0)))) (set var (1+ val)))) -- 2.11.4.GIT