changeset 81937:c2b7868011b1

* net/ange-ftp.el: (ange-ftp-file-remote-p): Handle optional parameter IDENTIFICATION.
author Michael Albinus <michael.albinus@gmx.de>
date Tue, 17 Jul 2007 21:09:12 +0000
parents 64c6efb87c40
children 26330ef1aa46
files lisp/net/ange-ftp.el
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/ange-ftp.el	Tue Jul 17 21:08:49 2007 +0000
+++ b/lisp/net/ange-ftp.el	Tue Jul 17 21:09:12 2007 +0000
@@ -4132,15 +4132,19 @@
 				       (format "Getting %s" fn1))
 	  tmp1))))
 
-(defun ange-ftp-file-remote-p (file &optional connected)
-  (and (or (not connected)
-	   (let* ((parsed (ange-ftp-ftp-name file))
-		  (host (nth 0 parsed))
-		  (user (nth 1 parsed))
-		  (proc (get-process (ange-ftp-ftp-process-buffer host user))))
-	     (and proc (processp proc)
-		  (memq (process-status proc) '(run open)))))
-       (ange-ftp-replace-name-component file "")))
+(defun ange-ftp-file-remote-p (file &optional identification connected)
+  (let* ((parsed (ange-ftp-ftp-name file))
+	 (host (nth 0 parsed))
+	 (user (nth 1 parsed)))
+    (and (or (not connected)
+	     (let ((proc (get-process (ange-ftp-ftp-process-buffer host user))))
+	       (and proc (processp proc)
+		    (memq (process-status proc) '(run open)))))
+	 (cond
+	  ((eq identification 'method) (and parsed "ftp"))
+	  ((eq identification 'user) user)
+	  ((eq identification 'host) host)
+	  (t (ange-ftp-replace-name-component file ""))))))
 
 (defun ange-ftp-load (file &optional noerror nomessage nosuffix)
   (if (ange-ftp-ftp-name file)