From: Michael Albinus Date: Tue, 17 Jul 2007 21:09:12 +0000 (+0000) Subject: * net/ange-ftp.el: (ange-ftp-file-remote-p): Handle optional X-Git-Tag: emacs-pretest-23.0.90~11864 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3bd84a2269913f7f5ee41c779a610b22d58c2d01;p=emacs.git * net/ange-ftp.el: (ange-ftp-file-remote-p): Handle optional parameter IDENTIFICATION. --- diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 3fa75102b32..24a30603bb9 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -4132,15 +4132,19 @@ directory, so that Emacs will know its current contents." (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)