# HG changeset patch # User Michael Albinus # Date 1183918116 0 # Node ID 44be65f35e4385038882ee463a7ca7d00d5a0362 # Parent c8bb24d5506d06334f01e5f5427d157b4b399245 * files.texi (Magic File Names): Introduce optional parameter CONNECTED for `file-remote-p'. diff -r c8bb24d5506d -r 44be65f35e43 lispref/ChangeLog --- a/lispref/ChangeLog Sun Jul 08 18:05:53 2007 +0000 +++ b/lispref/ChangeLog Sun Jul 08 18:08:36 2007 +0000 @@ -1,6 +1,11 @@ +2007-07-08 Michael Albinus + + * files.texi (Magic File Names): Introduce optional parameter + CONNECTED for `file-remote-p'. + 2007-07-07 Michael Albinus - * process.texi (Asynchronous Processes): + * processes.texi (Asynchronous Processes): * files.texi (Magic File Names): Add `start-file-process'. 2007-06-27 Richard Stallman diff -r c8bb24d5506d -r 44be65f35e43 lispref/files.texi --- a/lispref/files.texi Sun Jul 08 18:05:53 2007 +0000 +++ b/lispref/files.texi Sun Jul 08 18:08:36 2007 +0000 @@ -2768,7 +2768,7 @@ of the local copy file. @end defun -@defun file-remote-p filename +@defun file-remote-p filename &optional connected This function tests whether @var{filename} is a remote file. If @var{filename} is local (not remote), the return value is @code{nil}. If @var{filename} is indeed remote, the return value is a string that @@ -2777,7 +2777,7 @@ This identifier string can include a host name and a user name, as well as characters designating the method used to access the remote system. For example, the remote identifier string for the filename -@code{/ssh:user@@host:/some/file} is @code{/ssh:user@@host:}. +@code{/sudo::/some/file} is @code{/sudo:root@@localhost:}. If @code{file-remote-p} returns the same identifier for two different filenames, that means they are stored on the same file system and can @@ -2785,6 +2785,12 @@ example, that it is possible to start a remote process accessing both files at the same time. Implementors of file handlers need to ensure this principle is valid. + +The optional parameter @var{connected}, when passed non-@code{nil}, +triggers an additional check whether the remote system has been +connected already. The function returns then @code{nil} if there is +no corresponding open connection, even if @var{filename} is remote. +This can be used to avoid unnecessary connection attempts. @end defun @defun unhandled-file-name-directory filename