comparison lisp/files.el @ 90982:a66921565bcb

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 806-813) - Merge from emacs--rel--22 - Update from CVS * emacs--rel--22 (patch 51-58) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 233-236) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-230
author Miles Bader <miles@gnu.org>
date Sun, 15 Jul 2007 04:47:46 +0000
parents 988f1edc9674 cd3e38bb3dc7
children a1be62cbd32a
comparison
equal deleted inserted replaced
90981:a37d5bf6cbb7 90982:a66921565bcb
160 "*Non-nil means visit a file under its truename. 160 "*Non-nil means visit a file under its truename.
161 The truename of a file is found by chasing all links 161 The truename of a file is found by chasing all links
162 both at the file level and at the levels of the containing directories." 162 both at the file level and at the levels of the containing directories."
163 :type 'boolean 163 :type 'boolean
164 :group 'find-file) 164 :group 'find-file)
165 (put 'find-file-visit-truename 'safe-local-variable 'boolean) 165 (put 'find-file-visit-truename 'safe-local-variable 'booleanp)
166 166
167 (defcustom revert-without-query nil 167 (defcustom revert-without-query nil
168 "Specify which files should be reverted without query. 168 "Specify which files should be reverted without query.
169 The value is a list of regular expressions. 169 The value is a list of regular expressions.
170 If the file name matches one of these regular expressions, 170 If the file name matches one of these regular expressions,
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) 730 (defun file-remote-p (file &optional 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
739 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
741 to that remote system.
742
743 `file-remote-p' will never open a connection on its own."
738 (let ((handler (find-file-name-handler file 'file-remote-p))) 744 (let ((handler (find-file-name-handler file 'file-remote-p)))
739 (if handler 745 (if handler
740 (funcall handler 'file-remote-p file) 746 (funcall handler 'file-remote-p file connected)
741 nil))) 747 nil)))
742 748
743 (defun file-local-copy (file) 749 (defun file-local-copy (file)
744 "Copy the file FILE into a temporary file on this machine. 750 "Copy the file FILE into a temporary file on this machine.
745 Returns the name of the local copy, or nil, if FILE is directly 751 Returns the name of the local copy, or nil, if FILE is directly