diff options
| author | Michael Albinus | 2017-07-20 20:27:55 +0200 |
|---|---|---|
| committer | Michael Albinus | 2017-07-20 20:27:55 +0200 |
| commit | 290d0e733f15135696365be79285bceaaa2067f2 (patch) | |
| tree | 2b749bd7cc259860c7b859f850750d8cf3ebad59 | |
| parent | ee5ec64624b72fb5c18945949437c6371c76d14c (diff) | |
| download | emacs-290d0e733f15135696365be79285bceaaa2067f2.tar.gz emacs-290d0e733f15135696365be79285bceaaa2067f2.zip | |
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'.
| -rw-r--r-- | lisp/net/tramp-cache.el | 8 |
1 files 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." | |||
| 136 | (tramp-message key 8 "%s %s %s" file property value) | 136 | (tramp-message key 8 "%s %s %s" file property value) |
| 137 | (when (>= tramp-verbose 10) | 137 | (when (>= tramp-verbose 10) |
| 138 | (let* ((var (intern (concat "tramp-cache-get-count-" property))) | 138 | (let* ((var (intern (concat "tramp-cache-get-count-" property))) |
| 139 | (val (or (and (boundp var) (symbol-value var)) | 139 | (val (or (bound-and-true-p var) |
| 140 | (progn | 140 | (progn |
| 141 | (add-hook 'tramp-unload-hook | 141 | (add-hook 'tramp-cache-unload-hook |
| 142 | (lambda () (makunbound var))) | 142 | (lambda () (makunbound var))) |
| 143 | 0)))) | 143 | 0)))) |
| 144 | (set var (1+ val)))) | 144 | (set var (1+ val)))) |
| @@ -160,9 +160,9 @@ Returns VALUE." | |||
| 160 | (tramp-message key 8 "%s %s %s" file property value) | 160 | (tramp-message key 8 "%s %s %s" file property value) |
| 161 | (when (>= tramp-verbose 10) | 161 | (when (>= tramp-verbose 10) |
| 162 | (let* ((var (intern (concat "tramp-cache-set-count-" property))) | 162 | (let* ((var (intern (concat "tramp-cache-set-count-" property))) |
| 163 | (val (or (and (boundp var) (symbol-value var)) | 163 | (val (or (bound-and-true-p var) |
| 164 | (progn | 164 | (progn |
| 165 | (add-hook 'tramp-unload-hook | 165 | (add-hook 'tramp-cache-unload-hook |
| 166 | (lambda () (makunbound var))) | 166 | (lambda () (makunbound var))) |
| 167 | 0)))) | 167 | 0)))) |
| 168 | (set var (1+ val)))) | 168 | (set var (1+ val)))) |