Mercurial > emacs
comparison lisp/net/tramp-cache.el @ 94404:9ce39a6373c9
* net/tramp.el (tramp-handle-make-symbolic-link)
(tramp-handle-file-name-directory)
(tramp-handle-file-name-nondirectory, tramp-handle-file-truename)
(tramp-do-copy-or-rename-file-directly)
(tramp-handle-insert-directory, tramp-handle-expand-file-name)
(tramp-handle-substitute-in-file-name)
(tramp-handle-insert-file-contents, tramp-handle-write-region)
* net/tramp-cache.el (tramp-get-file-property)
(tramp-set-file-property, tramp-flush-file-property)
(tramp-flush-directory-property)
* net/tramp-cpmpat.el (tramp-compat-make-temp-file)
* net/tramp-fish.el (tramp-fish-handle-expand-file-name): Disable
`file-name-handler-alist' when handling localname. It could have
a remote file syntax, like a VMS file name.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Sun, 27 Apr 2008 16:36:56 +0000 |
parents | 202f9737703b |
children | 91e5880a36c1 |
comparison
equal
deleted
inserted
replaced
94403:f3fa6258dd50 | 94404:9ce39a6373c9 |
---|---|
93 (defun tramp-get-file-property (vec file property default) | 93 (defun tramp-get-file-property (vec file property default) |
94 "Get the PROPERTY of FILE from the cache context of VEC. | 94 "Get the PROPERTY of FILE from the cache context of VEC. |
95 Returns DEFAULT if not set." | 95 Returns DEFAULT if not set." |
96 ;; Unify localname. | 96 ;; Unify localname. |
97 (setq vec (copy-sequence vec)) | 97 (setq vec (copy-sequence vec)) |
98 (aset vec 3 (directory-file-name file)) | 98 (aset vec 3 (tramp-run-real-handler 'directory-file-name (list file))) |
99 (let* ((hash (or (gethash vec tramp-cache-data) | 99 (let* ((hash (or (gethash vec tramp-cache-data) |
100 (puthash vec (make-hash-table :test 'equal) | 100 (puthash vec (make-hash-table :test 'equal) |
101 tramp-cache-data))) | 101 tramp-cache-data))) |
102 (value (if (hash-table-p hash) | 102 (value (if (hash-table-p hash) |
103 (gethash property hash default) | 103 (gethash property hash default) |
108 (defun tramp-set-file-property (vec file property value) | 108 (defun tramp-set-file-property (vec file property value) |
109 "Set the PROPERTY of FILE to VALUE, in the cache context of VEC. | 109 "Set the PROPERTY of FILE to VALUE, in the cache context of VEC. |
110 Returns VALUE." | 110 Returns VALUE." |
111 ;; Unify localname. | 111 ;; Unify localname. |
112 (setq vec (copy-sequence vec)) | 112 (setq vec (copy-sequence vec)) |
113 (aset vec 3 (directory-file-name file)) | 113 (aset vec 3 (tramp-run-real-handler 'directory-file-name (list file))) |
114 (let ((hash (or (gethash vec tramp-cache-data) | 114 (let ((hash (or (gethash vec tramp-cache-data) |
115 (puthash vec (make-hash-table :test 'equal) | 115 (puthash vec (make-hash-table :test 'equal) |
116 tramp-cache-data)))) | 116 tramp-cache-data)))) |
117 (puthash property value hash) | 117 (puthash property value hash) |
118 (tramp-message vec 8 "%s %s %s" file property value) | 118 (tramp-message vec 8 "%s %s %s" file property value) |
120 | 120 |
121 (defun tramp-flush-file-property (vec file) | 121 (defun tramp-flush-file-property (vec file) |
122 "Remove all properties of FILE in the cache context of VEC." | 122 "Remove all properties of FILE in the cache context of VEC." |
123 ;; Unify localname. | 123 ;; Unify localname. |
124 (setq vec (copy-sequence vec)) | 124 (setq vec (copy-sequence vec)) |
125 (aset vec 3 (directory-file-name file)) | 125 (aset vec 3 (tramp-run-real-handler 'directory-file-name (list file))) |
126 (tramp-message vec 8 "%s" file) | 126 (tramp-message vec 8 "%s" file) |
127 (remhash vec tramp-cache-data)) | 127 (remhash vec tramp-cache-data)) |
128 | 128 |
129 (defun tramp-flush-directory-property (vec directory) | 129 (defun tramp-flush-directory-property (vec directory) |
130 "Remove all properties of DIRECTORY in the cache context of VEC. | 130 "Remove all properties of DIRECTORY in the cache context of VEC. |
131 Remove also properties of all files in subdirectories." | 131 Remove also properties of all files in subdirectories." |
132 (let ((directory (directory-file-name directory))) | 132 (let ((directory (tramp-run-real-handler |
133 'directory-file-name (list directory)))) | |
133 (tramp-message vec 8 "%s" directory) | 134 (tramp-message vec 8 "%s" directory) |
134 (maphash | 135 (maphash |
135 '(lambda (key value) | 136 '(lambda (key value) |
136 (when (and (stringp key) | 137 (when (and (stringp key) |
137 (string-match directory (tramp-file-name-localname key))) | 138 (string-match directory (tramp-file-name-localname key))) |