comparison lisp/files.el @ 55845:6d0508ef2a09

(file-remote-p): Apply file name handler for operation `file-remote-p'. It isn' a property any longer. (file-relative-name): `fh' and `fd' get the required value via `find-file-name-handler' already.
author Michael Albinus <michael.albinus@gmx.de>
date Sat, 29 May 2004 22:42:06 +0000
parents ef8edc11a6e4
children a713acca9ca9
comparison
equal deleted inserted replaced
55844:4bc6cb45c326 55845:6d0508ef2a09
640 (cons load-path load-suffixes)))) 640 (cons load-path load-suffixes))))
641 (load library)) 641 (load library))
642 642
643 (defun file-remote-p (file) 643 (defun file-remote-p (file)
644 "Test whether FILE specifies a location on a remote system." 644 "Test whether FILE specifies a location on a remote system."
645 (let ((handler (find-file-name-handler file 'file-local-copy))) 645 (let ((handler (find-file-name-handler file 'file-remote-p)))
646 (if handler 646 (if handler
647 (get handler 'file-remote-p)))) 647 (funcall handler 'file-remote-p file)
648 nil)))
648 649
649 (defun file-local-copy (file) 650 (defun file-local-copy (file)
650 "Copy the file FILE into a temporary file on this machine. 651 "Copy the file FILE into a temporary file on this machine.
651 Returns the name of the local copy, or nil, if FILE is directly 652 Returns the name of the local copy, or nil, if FILE is directly
652 accessible." 653 accessible."
2901 (save-match-data 2902 (save-match-data
2902 (setq directory 2903 (setq directory
2903 (file-name-as-directory (expand-file-name (or directory 2904 (file-name-as-directory (expand-file-name (or directory
2904 default-directory)))) 2905 default-directory))))
2905 (setq filename (expand-file-name filename)) 2906 (setq filename (expand-file-name filename))
2906 (let ((hf (find-file-name-handler filename 'file-local-copy)) 2907 (let ((hf (find-file-name-handler filename 'file-remote-p))
2907 (hd (find-file-name-handler directory 'file-local-copy))) 2908 (hd (find-file-name-handler directory 'file-remote-p)))
2908 (when (and hf (not (get hf 'file-remote-p))) (setq hf nil))
2909 (when (and hd (not (get hd 'file-remote-p))) (setq hd nil))
2910 (if ;; Conditions for separate trees 2909 (if ;; Conditions for separate trees
2911 (or 2910 (or
2912 ;; Test for different drives on DOS/Windows 2911 ;; Test for different drives on DOS/Windows
2913 (and 2912 (and
2914 ;; Should `cygwin' really be included here? --stef 2913 ;; Should `cygwin' really be included here? --stef