aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Großjohann2004-06-26 14:41:13 +0000
committerKai Großjohann2004-06-26 14:41:13 +0000
commit3f788773973454ef6bd068fd1b300da42786b72c (patch)
treea3f6a71997ce0b1d98fb5b4a68855fd16607738f
parent2101105e6f01a51e7512f8df13191a15c70bdf9c (diff)
downloademacs-3f788773973454ef6bd068fd1b300da42786b72c.tar.gz
emacs-3f788773973454ef6bd068fd1b300da42786b72c.zip
* net/ange-ftp.el (ange-ftp-file-remote-p): New return value,
according to new documentation of `file-remote-p'. * files.el (file-remote-p): Fix doc to say that return value is identification of remote system, if not nil. (file-relative-name): Use new return value of `file-remote-p'.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/files.el26
-rw-r--r--lisp/net/ange-ftp.el2
3 files changed, 20 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index db83497b055..69ba9cc6b82 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12004-06-26 Kai Grossjohann <kai.grossjohann@gmx.net>
2
3 * net/ange-ftp.el (ange-ftp-file-remote-p): New return value,
4 according to new documentation of `file-remote-p'.
5
6 * files.el (file-remote-p): Fix doc to say that return value is
7 identification of remote system, if not nil.
8 (file-relative-name): Use new return value of `file-remote-p'.
9
12004-06-26 Nick Roberts <nickrob@gnu.org> 102004-06-26 Nick Roberts <nickrob@gnu.org>
2 11
3 * progmodes/gdb-ui.el (gdb-toggle-breakpoint) 12 * progmodes/gdb-ui.el (gdb-toggle-breakpoint)
diff --git a/lisp/files.el b/lisp/files.el
index cd11f07969f..301a3f48f15 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -650,7 +650,13 @@ This is an interface to the function `load'."
650 (load library)) 650 (load library))
651 651
652(defun file-remote-p (file) 652(defun file-remote-p (file)
653 "Test whether FILE specifies a location on a remote system." 653 "Test whether FILE specifies a location on a remote system.
654Return an identification of the system if the location is indeed
655remote. The identification of the system may comprise a method
656to access the system and its hostname, amongst other things.
657
658For example, the filename \"/user@host:/foo\" specifies a location
659on the system \"/user@host:\"."
654 (let ((handler (find-file-name-handler file 'file-remote-p))) 660 (let ((handler (find-file-name-handler file 'file-remote-p)))
655 (if handler 661 (if handler
656 (funcall handler 'file-remote-p file) 662 (funcall handler 'file-remote-p file)
@@ -2916,8 +2922,8 @@ on a DOS/Windows machine, it returns FILENAME on expanded form."
2916 (file-name-as-directory (expand-file-name (or directory 2922 (file-name-as-directory (expand-file-name (or directory
2917 default-directory)))) 2923 default-directory))))
2918 (setq filename (expand-file-name filename)) 2924 (setq filename (expand-file-name filename))
2919 (let ((hf (find-file-name-handler filename 'file-remote-p)) 2925 (let ((fremote (file-remote-p filename))
2920 (hd (find-file-name-handler directory 'file-remote-p))) 2926 (dremote (file-remote-p directory)))
2921 (if ;; Conditions for separate trees 2927 (if ;; Conditions for separate trees
2922 (or 2928 (or
2923 ;; Test for different drives on DOS/Windows 2929 ;; Test for different drives on DOS/Windows
@@ -2925,20 +2931,8 @@ on a DOS/Windows machine, it returns FILENAME on expanded form."
2925 ;; Should `cygwin' really be included here? --stef 2931 ;; Should `cygwin' really be included here? --stef
2926 (memq system-type '(ms-dos cygwin windows-nt)) 2932 (memq system-type '(ms-dos cygwin windows-nt))
2927 (not (eq t (compare-strings filename 0 2 directory 0 2)))) 2933 (not (eq t (compare-strings filename 0 2 directory 0 2))))
2928 ;; Test for different remote file handlers
2929 (not (eq hf hd))
2930 ;; Test for different remote file system identification 2934 ;; Test for different remote file system identification
2931 (and 2935 (not (equal fremote dremote)))
2932 hf
2933 (let ((re (car (rassq hf file-name-handler-alist))))
2934 (not
2935 (equal
2936 (and
2937 (string-match re filename)
2938 (substring filename 0 (match-end 0)))
2939 (and
2940 (string-match re directory)
2941 (substring directory 0 (match-end 0))))))))
2942 filename 2936 filename
2943 (let ((ancestor ".") 2937 (let ((ancestor ".")
2944 (filename-dir (file-name-as-directory filename))) 2938 (filename-dir (file-name-as-directory filename)))
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 09448e87329..8e9d0bda5af 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -4117,7 +4117,7 @@ directory, so that Emacs will know its current contents."
4117 tmp1)))) 4117 tmp1))))
4118 4118
4119(defun ange-ftp-file-remote-p (file) 4119(defun ange-ftp-file-remote-p (file)
4120 (when (ange-ftp-ftp-name file) t)) 4120 (ange-ftp-replace-name-component file ""))
4121 4121
4122(defun ange-ftp-load (file &optional noerror nomessage nosuffix) 4122(defun ange-ftp-load (file &optional noerror nomessage nosuffix)
4123 (if (ange-ftp-ftp-name file) 4123 (if (ange-ftp-ftp-name file)