/[emacs]/emacs/lisp/files.el
ViewVC logotype

Diff of /emacs/lisp/files.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.583.2.17 by miles, Tue Jul 6 10:20:16 2004 UTC revision 1.583.2.18 by miles, Tue Jul 6 10:23:35 2004 UTC
# Line 650  This is an interface to the function `lo Line 650  This is an interface to the function `lo
650    (load library))    (load library))
651    
652  (defun file-remote-p (file)  (defun file-remote-p (file)
653    "Test whether FILE specifies a location on a remote system."    "Test whether FILE specifies a location on a remote system.
654    Return an identification of the system if the location is indeed
655    remote.  The identification of the system may comprise a method
656    to access the system and its hostname, amongst other things.
657    
658    For example, the filename \"/user@host:/foo\" specifies a location
659    on the system \"/user@host:\"."
660    (let ((handler (find-file-name-handler file 'file-remote-p)))    (let ((handler (find-file-name-handler file 'file-remote-p)))
661      (if handler      (if handler
662          (funcall handler 'file-remote-p file)          (funcall handler 'file-remote-p file)
# Line 2916  on a DOS/Windows machine, it returns FIL Line 2922  on a DOS/Windows machine, it returns FIL
2922            (file-name-as-directory (expand-file-name (or directory            (file-name-as-directory (expand-file-name (or directory
2923                                                          default-directory))))                                                          default-directory))))
2924      (setq filename (expand-file-name filename))      (setq filename (expand-file-name filename))
2925      (let ((hf (find-file-name-handler filename 'file-remote-p))      (let ((fremote (file-remote-p filename))
2926            (hd (find-file-name-handler directory 'file-remote-p)))            (dremote (file-remote-p directory)))
2927        (if ;; Conditions for separate trees        (if ;; Conditions for separate trees
2928            (or            (or
2929             ;; Test for different drives on DOS/Windows             ;; Test for different drives on DOS/Windows
# Line 2925  on a DOS/Windows machine, it returns FIL Line 2931  on a DOS/Windows machine, it returns FIL
2931              ;; Should `cygwin' really be included here?  --stef              ;; Should `cygwin' really be included here?  --stef
2932              (memq system-type '(ms-dos cygwin windows-nt))              (memq system-type '(ms-dos cygwin windows-nt))
2933              (not (eq t (compare-strings filename 0 2 directory 0 2))))              (not (eq t (compare-strings filename 0 2 directory 0 2))))
            ;; Test for different remote file handlers  
            (not (eq hf hd))  
2934             ;; Test for different remote file system identification             ;; Test for different remote file system identification
2935             (and             (not (equal fremote dremote)))
             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))))))))  
2936            filename            filename
2937          (let ((ancestor ".")          (let ((ancestor ".")
2938                (filename-dir (file-name-as-directory filename)))                (filename-dir (file-name-as-directory filename)))

Legend:
Removed from v.1.583.2.17  
changed lines
  Added in v.1.583.2.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26