comparison lisp/files.el @ 90984:a1be62cbd32a

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 814-815) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-232
author Miles Bader <miles@gnu.org>
date Wed, 18 Jul 2007 22:15:15 +0000
parents a66921565bcb 7a3210e699fe
children 492971a3f31f
comparison
equal deleted inserted replaced
90983:8cdd8b5fa891 90984:a1be62cbd32a
725 (list (completing-read "Load library: " 725 (list (completing-read "Load library: "
726 'locate-file-completion 726 'locate-file-completion
727 (cons load-path (get-load-suffixes))))) 727 (cons load-path (get-load-suffixes)))))
728 (load library)) 728 (load library))
729 729
730 (defun file-remote-p (file &optional connected) 730 (defun file-remote-p (file &optional identification connected)
731 "Test whether FILE specifies a location on a remote system. 731 "Test whether FILE specifies a location on a remote system.
732 Return an identification of the system if the location is indeed 732 Return an identification of the system if the location is indeed
733 remote. The identification of the system may comprise a method 733 remote. The identification of the system may comprise a method
734 to access the system and its hostname, amongst other things. 734 to access the system and its hostname, amongst other things.
735 735
736 For example, the filename \"/user@host:/foo\" specifies a location 736 For example, the filename \"/user@host:/foo\" specifies a location
737 on the system \"/user@host:\". 737 on the system \"/user@host:\".
738 738
739 IDENTIFICATION specifies which part of the identification shall
740 be returned as string. IDENTIFICATION can be the symbol
741 `method', `user' or `host'; any other value is handled like nil
742 and means to return the complete identification string.
743
739 If CONNECTED is non-nil, the function returns an identification only 744 If CONNECTED is non-nil, the function returns an identification only
740 if FILE is located on a remote system, and a connection is established 745 if FILE is located on a remote system, and a connection is established
741 to that remote system. 746 to that remote system.
742 747
743 `file-remote-p' will never open a connection on its own." 748 `file-remote-p' will never open a connection on its own."
744 (let ((handler (find-file-name-handler file 'file-remote-p))) 749 (let ((handler (find-file-name-handler file 'file-remote-p)))
745 (if handler 750 (if handler
746 (funcall handler 'file-remote-p file connected) 751 (funcall handler 'file-remote-p file identification connected)
747 nil))) 752 nil)))
748 753
749 (defun file-local-copy (file) 754 (defun file-local-copy (file)
750 "Copy the file FILE into a temporary file on this machine. 755 "Copy the file FILE into a temporary file on this machine.
751 Returns the name of the local copy, or nil, if FILE is directly 756 Returns the name of the local copy, or nil, if FILE is directly