summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2007-07-08 18:08:36 +0000
committerMichael Albinus <michael.albinus@gmx.de>2007-07-08 18:08:36 +0000
commit62256aa78bd801c83724159b129259455eaf63ad (patch)
tree7ddf4d79d446b1e8885cb80b55a99331593cd8cb
parent7aa8eec2fbf6c79f2e1ec2dcbbdacea311389538 (diff)
* files.texi (Magic File Names): Introduce optional parameter
CONNECTED for `file-remote-p'.
-rw-r--r--lispref/ChangeLog7
-rw-r--r--lispref/files.texi10
2 files changed, 14 insertions, 3 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 5c25f0945a..d7295bd64b 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,6 +1,11 @@
+2007-07-08 Michael Albinus <michael.albinus@gmx.de>
+
+ * files.texi (Magic File Names): Introduce optional parameter
+ CONNECTED for `file-remote-p'.
+
2007-07-07 Michael Albinus <michael.albinus@gmx.de>
- * process.texi (Asynchronous Processes):
+ * processes.texi (Asynchronous Processes):
* files.texi (Magic File Names): Add `start-file-process'.
2007-06-27 Richard Stallman <rms@gnu.org>
diff --git a/lispref/files.texi b/lispref/files.texi
index 5af77fafc3..eacb641a8b 100644
--- a/lispref/files.texi
+++ b/lispref/files.texi
@@ -2768,7 +2768,7 @@ nothing and returns @code{nil}. Otherwise it returns the file name
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 @@ identifies the remote system.
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 @@ be accessed locally with respect to each other. This means, for
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