1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/changeset/ee95ef1e644c/
changeset: ee95ef1e644c
user: sperber
date: 2012-07-02 20:39:12
summary: Update `file-name-remote-p'.
2008-01-03 Michael Sperber <mike(a)xemacs.org>
* files.el (file-remote-p): Synch with GNU Emac: Add
`identification' and `connected' parameters, and use file-name
handler if available. Zap support for ange-ftp.
affected #: 2 files
diff -r b4715fcbe00185e5ab8c00208e14d15fb3c936a9 -r
ee95ef1e644cb3187b1e053b3489781cc3cfa99b lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -5208,6 +5208,12 @@
Bind print-gensym-alist to nil, as we do within
byte-compile-output-docform.
+2008-01-03 Michael Sperber <mike(a)xemacs.org>
+
+ * files.el (file-remote-p): Synch with GNU Emac: Add
+ `identification' and `connected' parameters, and use file-name
+ handler if available. Zap support for ange-ftp.
+
2008-01-04 Michael Sperber <mike(a)xemacs.org>
* code-files.el (insert-file-contents):
diff -r b4715fcbe00185e5ab8c00208e14d15fb3c936a9 -r
ee95ef1e644cb3187b1e053b3489781cc3cfa99b lisp/files.el
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4482,14 +4482,46 @@
(error "Apparently circular symlink path"))))
;; Suggested by Michael Kifer <kifer(a)CS.SunySB.EDU>
-(defun file-remote-p (file-name)
- "Test whether FILE-NAME is looked for on a remote system."
- (cond ((not (declare-boundp allow-remote-paths)) nil)
- ((fboundp 'ange-ftp-ftp-path)
- (declare-fboundp (ange-ftp-ftp-path file-name)))
- ((fboundp 'efs-ftp-path)
- (declare-fboundp (efs-ftp-path file-name)))
- (t nil)))
+(defun file-remote-p (file &optional identification connected)
+ "Test whether FILE specifies a location on a remote system.
+Return an identification of the system if the location is indeed
+remote. The identification of the system may comprise a method
+to access the system and its hostname, amongst other things.
+
+For example, the filename \"/user@host:/foo\" specifies a location
+on the system \"/user@host:\".
+
+IDENTIFICATION specifies which part of the identification shall
+be returned as string. IDENTIFICATION can be the symbol
+`method', `user' or `host'; any other value is handled like nil
+and means to return the complete identification string.
+
+If CONNECTED is non-nil, the function returns an identification only
+if FILE is located on a remote system, and a connection is established
+to that remote system.
+
+`file-remote-p' will never open a connection on its own."
+ (let ((handler (find-file-name-handler file 'file-remote-p)))
+ (cond
+ (handler
+ (funcall handler 'file-remote-p file identification connected))
+ ;; legacy code; can probably go by mid-2008
+ ((fboundp 'efs-ftp-path)
+ (let ((parsed (declare-fboundp (efs-ftp-path file))))
+ (and parsed
+ (let ((host (nth 0 parsed))
+ (user (nth 1 parsed)))
+ (and (or (not connected)
+ (let ((proc (get-process (declare-fboundp (efs-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
+ (concat "/" user "@" host ":/"))))))))
+ (t nil))))
;; We use /: as a prefix to "quote" a file name
Repository URL:
https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches