]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/ange-ftp.el (ange-ftp-file-remote-p): New return value,
authorKai Großjohann <kgrossjo@eu.uu.net>
Sat, 26 Jun 2004 14:41:13 +0000 (14:41 +0000)
committerKai Großjohann <kgrossjo@eu.uu.net>
Sat, 26 Jun 2004 14:41:13 +0000 (14:41 +0000)
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'.

lisp/ChangeLog
lisp/files.el
lisp/net/ange-ftp.el

index db83497b0552fff5cdd0f6fb771bf5cc178ddfe9..69ba9cc6b825afb43656f407f6b6e2df097427df 100644 (file)
@@ -1,3 +1,12 @@
+2004-06-26  Kai Grossjohann  <kai.grossjohann@gmx.net>
+
+       * 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'.
+
 2004-06-26  Nick Roberts  <nickrob@gnu.org>
 
        * progmodes/gdb-ui.el (gdb-toggle-breakpoint) 
index cd11f07969fc5efef8c1d0f7147d76e2901de392..301a3f48f1579a8f7cfeed559cfd5fe9308aa5e4 100644 (file)
@@ -650,7 +650,13 @@ This is an interface to the function `load'."
   (load library))
 
 (defun file-remote-p (file)
-  "Test whether FILE specifies a location on a remote system."
+  "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:\"."
   (let ((handler (find-file-name-handler file 'file-remote-p)))
     (if handler
        (funcall handler 'file-remote-p file)
@@ -2916,8 +2922,8 @@ on a DOS/Windows machine, it returns FILENAME on expanded form."
          (file-name-as-directory (expand-file-name (or directory
                                                        default-directory))))
     (setq filename (expand-file-name filename))
-    (let ((hf (find-file-name-handler filename 'file-remote-p))
-          (hd (find-file-name-handler directory 'file-remote-p)))
+    (let ((fremote (file-remote-p filename))
+          (dremote (file-remote-p directory)))
       (if ;; Conditions for separate trees
          (or
           ;; Test for different drives on DOS/Windows
@@ -2925,20 +2931,8 @@ on a DOS/Windows machine, it returns FILENAME on expanded form."
            ;; Should `cygwin' really be included here?  --stef
            (memq system-type '(ms-dos cygwin windows-nt))
            (not (eq t (compare-strings filename 0 2 directory 0 2))))
-          ;; Test for different remote file handlers
-          (not (eq hf hd))
           ;; Test for different remote file system identification
-          (and
-           hf
-           (let ((re (car (rassq hf file-name-handler-alist))))
-             (not
-              (equal
-               (and
-                (string-match re filename)
-                (substring filename 0 (match-end 0)))
-               (and
-                (string-match re directory)
-                (substring directory 0 (match-end 0))))))))
+          (not (equal fremote dremote)))
          filename
         (let ((ancestor ".")
              (filename-dir (file-name-as-directory filename)))
index 09448e8732940a37dfe871f22b45679ac9a2bebf..8e9d0bda5af8b41b72f8084ab9f0e757cf784e31 100644 (file)
@@ -4117,7 +4117,7 @@ directory, so that Emacs will know its current contents."
          tmp1))))
 
 (defun ange-ftp-file-remote-p (file)
-  (when (ange-ftp-ftp-name file) t))
+  (ange-ftp-replace-name-component file ""))
 
 (defun ange-ftp-load (file &optional noerror nomessage nosuffix)
   (if (ange-ftp-ftp-name file)