]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp-ftp.el
Merge from emacs--rel--22
[gnu-emacs] / lisp / net / tramp-ftp.el
index 894fef4a43b03da9f84a786122edcca5bcf0445f..b05add13cd9ba09868e6502be96d7e16457cb836 100644 (file)
@@ -8,10 +8,10 @@
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,8 +19,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, see
-;; <http://www.gnu.org/licenses/>.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -121,6 +120,13 @@ present for backward compatibility."
 ;; If there is URL syntax, `substitute-in-file-name' needs special
 ;; handling.
 (put 'substitute-in-file-name 'ange-ftp 'tramp-handle-substitute-in-file-name)
+(add-hook 'tramp-ftp-unload-hook
+         '(lambda ()
+            (setplist 'substitute-in-file-name
+                      (delete 'ange-ftp
+                              (delete 'tramp-handle-substitute-in-file-name
+                                      (symbol-plist
+                                       'substitute-in-file-name))))))
 
 (defun tramp-ftp-file-name-handler (operation &rest args)
   "Invoke the Ange-FTP handler for OPERATION.
@@ -179,7 +185,12 @@ pass to the OPERATION."
            (ignore-errors (delete-file tmpfile)))))
 
        ;; Normally, the handlers must be discarded.
-       (t (let* ((inhibit-file-name-handlers
+       ;; `inhibit-file-name-handlers' isn't sufficient, because the
+       ;; local file name could be in Tramp syntax as well (for
+       ;; example, returning VMS file names like "/DISK$CAM:/AAA").
+       ;; That's why we set also `tramp-mode' to nil.
+       (t (let* (;(tramp-mode nil)
+                (inhibit-file-name-handlers
                  (list 'tramp-file-name-handler
                        'tramp-completion-file-name-handler
                        (and (eq inhibit-file-name-operation operation)