summaryrefslogtreecommitdiff
path: root/lisp/net/ange-ftp.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2007-07-17 21:09:12 +0000
committerMichael Albinus <michael.albinus@gmx.de>2007-07-17 21:09:12 +0000
commit3bd84a2269913f7f5ee41c779a610b22d58c2d01 (patch)
tree463ae1f8f325aaded86d4d04c3cc5297dc196d99 /lisp/net/ange-ftp.el
parent05c7c7b162827d99fbb0f0a3f80e51173525c174 (diff)
downloademacs-3bd84a2269913f7f5ee41c779a610b22d58c2d01.tar.gz
emacs-3bd84a2269913f7f5ee41c779a610b22d58c2d01.tar.bz2
emacs-3bd84a2269913f7f5ee41c779a610b22d58c2d01.zip
* net/ange-ftp.el: (ange-ftp-file-remote-p): Handle optional
parameter IDENTIFICATION.
Diffstat (limited to 'lisp/net/ange-ftp.el')
-rw-r--r--lisp/net/ange-ftp.el22
1 files changed, 13 insertions, 9 deletions
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)