X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/266a86bd7fedf743225c2497956b73ecb2245196..493c66882d491bcd6178e580abea92787f3e1555:/lisp/net/tramp-ftp.el diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el index 7f8b7454ca..44ae176c6c 100644 --- a/lisp/net/tramp-ftp.el +++ b/lisp/net/tramp-ftp.el @@ -1,7 +1,6 @@ ;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP -;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, -;; 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2002-2012 Free Software Foundation, Inc. ;; Author: Michael Albinus ;; Keywords: comm, processes @@ -50,9 +49,8 @@ (defun tramp-disable-ange-ftp () "Turn Ange-FTP off. This is useful for unified remoting. See -`tramp-file-name-structure-unified' and -`tramp-file-name-structure-separate' for details. Requests suitable -for Ange-FTP will be forwarded to Ange-FTP. Also see the variables +`tramp-file-name-structure' for details. Requests suitable for +Ange-FTP will be forwarded to Ange-FTP. Also see the variables `tramp-ftp-method', `tramp-default-method', and `tramp-default-method-alist'. @@ -100,34 +98,36 @@ present for backward compatibility." ;; Define FTP method ... ;;;###tramp-autoload (defconst tramp-ftp-method "ftp" - "*When this method name is used, forward all calls to Ange-FTP.") + "When this method name is used, forward all calls to Ange-FTP.") ;; ... and add it to the method list. ;;;###tramp-autoload (unless (featurep 'xemacs) - (add-to-list 'tramp-methods (cons tramp-ftp-method nil))) + (add-to-list 'tramp-methods (cons tramp-ftp-method nil)) -;; Add some defaults for `tramp-default-method-alist' -(add-to-list 'tramp-default-method-alist - (list "\\`ftp\\." "" tramp-ftp-method)) -(add-to-list 'tramp-default-method-alist - (list "" "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method)) + ;; Add some defaults for `tramp-default-method-alist'. + (add-to-list 'tramp-default-method-alist + (list "\\`ftp\\." nil tramp-ftp-method)) + (add-to-list 'tramp-default-method-alist + (list nil "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method))) ;; Add completion function for FTP method. -(tramp-set-completion-function - tramp-ftp-method - '((tramp-parse-netrc "~/.netrc"))) +;;;###tramp-autoload +(eval-after-load 'tramp + '(tramp-set-completion-function + tramp-ftp-method + '((tramp-parse-netrc "~/.netrc")))) ;; 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)))))) + (lambda () + (setplist 'substitute-in-file-name + (delete 'ange-ftp + (delete 'tramp-handle-substitute-in-file-name + (symbol-plist + 'substitute-in-file-name)))))) ;;;###tramp-autoload (defun tramp-ftp-file-name-handler (operation &rest args) @@ -203,8 +203,8 @@ pass to the OPERATION." ;;;###tramp-autoload (defsubst tramp-ftp-file-name-p (filename) "Check if it's a filename that should be forwarded to Ange-FTP." - (let ((v (tramp-dissect-file-name filename))) - (string= (tramp-file-name-method v) tramp-ftp-method))) + (string= (tramp-file-name-method (tramp-dissect-file-name filename)) + tramp-ftp-method)) ;;;###tramp-autoload (unless (featurep 'xemacs) @@ -221,5 +221,4 @@ pass to the OPERATION." ;; * There are no backup files on FTP hosts. -;; arch-tag: 759fb338-5c63-4b99-bd36-b4d59db91cff ;;; tramp-ftp.el ends here