From: Michael Albinus Date: Thu, 20 Jul 2017 18:27:55 +0000 (+0200) Subject: Stylistic changes in tramp-cache.el X-Git-Tag: emacs-26.0.90~518^2~49 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=290d0e733f15135696365be79285bceaaa2067f2;p=emacs.git 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'. --- 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))))