Mercurial > emacs
comparison lisp/net/tramp-ftp.el @ 96391:c114f6a4c246
* net/tramp-ftp.el (top): Delete 'ange-ftp property from
`substitute-in-file-name' when unloading.
(tramp-ftp-file-name-handler): Set `tramp-mode' to nil.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Sat, 28 Jun 2008 10:15:00 +0000 |
parents | 91e5880a36c1 |
children | 712b49aaccfd |
comparison
equal
deleted
inserted
replaced
96390:02d657f45045 | 96391:c114f6a4c246 |
---|---|
118 '((tramp-parse-netrc "~/.netrc"))) | 118 '((tramp-parse-netrc "~/.netrc"))) |
119 | 119 |
120 ;; If there is URL syntax, `substitute-in-file-name' needs special | 120 ;; If there is URL syntax, `substitute-in-file-name' needs special |
121 ;; handling. | 121 ;; handling. |
122 (put 'substitute-in-file-name 'ange-ftp 'tramp-handle-substitute-in-file-name) | 122 (put 'substitute-in-file-name 'ange-ftp 'tramp-handle-substitute-in-file-name) |
123 (add-hook 'tramp-ftp-unload-hook | |
124 '(lambda () | |
125 (setplist 'substitute-in-file-name | |
126 (delete 'ange-ftp | |
127 (delete 'tramp-handle-substitute-in-file-name | |
128 (symbol-plist | |
129 'substitute-in-file-name)))))) | |
123 | 130 |
124 (defun tramp-ftp-file-name-handler (operation &rest args) | 131 (defun tramp-ftp-file-name-handler (operation &rest args) |
125 "Invoke the Ange-FTP handler for OPERATION. | 132 "Invoke the Ange-FTP handler for OPERATION. |
126 First arg specifies the OPERATION, second arg is a list of arguments to | 133 First arg specifies the OPERATION, second arg is a list of arguments to |
127 pass to the OPERATION." | 134 pass to the OPERATION." |
176 (rename-file tmpfile newname (car args)) | 183 (rename-file tmpfile newname (car args)) |
177 ;; Cleanup. | 184 ;; Cleanup. |
178 (ignore-errors (delete-file tmpfile))))) | 185 (ignore-errors (delete-file tmpfile))))) |
179 | 186 |
180 ;; Normally, the handlers must be discarded. | 187 ;; Normally, the handlers must be discarded. |
181 (t (let* ((inhibit-file-name-handlers | 188 ;; `inhibit-file-name-handlers' isn't sufficient, because the |
189 ;; local file name could be in Tramp syntax as well (for | |
190 ;; example, returning VMS file names like "/DISK$CAM:/AAA"). | |
191 ;; That's why we set also `tramp-mode' to nil. | |
192 (t (let* ((tramp-mode nil) | |
193 (inhibit-file-name-handlers | |
182 (list 'tramp-file-name-handler | 194 (list 'tramp-file-name-handler |
183 'tramp-completion-file-name-handler | 195 'tramp-completion-file-name-handler |
184 (and (eq inhibit-file-name-operation operation) | 196 (and (eq inhibit-file-name-operation operation) |
185 inhibit-file-name-handlers))) | 197 inhibit-file-name-handlers))) |
186 (inhibit-file-name-operation operation)) | 198 (inhibit-file-name-operation operation)) |