]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp-ftp.el
* net/tramp.el (tramp-handle-directory-files-and-attributes-with-stat)
[gnu-emacs] / lisp / net / tramp-ftp.el
index 3bac605480dd9d247c154371169b7f3735977daa..eed7f92b0e97cf945a1c8c60187cce32e27ead3e 100644 (file)
@@ -1,7 +1,7 @@
 ;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP
 
 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007,
-;;   2008 Free Software Foundation, Inc.
+;;   2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
@@ -120,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.
@@ -178,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)