Skip to content

Commit 0218fb2

Browse files
committed
Adapt file-remote-p doc
* doc/lispref/files.texi (Magic File Names): Adapt file-remote-p. * lisp/files.el (file-remote-p): Adapt docstring.
1 parent 34c1094 commit 0218fb2

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

doc/lispref/files.texi

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3624,10 +3624,18 @@ ensure this principle is valid.
36243624

36253625
@var{identification} specifies which part of the identifier shall be
36263626
returned as string. @var{identification} can be the symbol
3627-
@code{method}, @code{user} or @code{host}; any other value is handled
3628-
like @code{nil} and means to return the complete identifier string.
3629-
In the example above, the remote @code{user} identifier string would
3630-
be @code{root}.
3627+
@code{method}, @code{user}, @code{host} or @code{localname}; any other
3628+
value is handled like @code{nil} and means to return the complete
3629+
identifier string. In the example above, the remote @code{user}
3630+
identifier string would be @code{root}.
3631+
3632+
If the remote @var{file} does not contain a method, a user name, or a
3633+
host name, the respective default value is returned. The string
3634+
returned for @var{identification} @code{localname} can differ depending
3635+
on whether there is an existing connection. File name handler specific
3636+
implementations could support further @var{identification} symbols;
3637+
@xref{Top, Tramp, Tramp, tramp}, for example, knows also the @code{hop}
3638+
symbol.
36313639

36323640
If @var{connected} is non-@code{nil}, this function returns @code{nil}
36333641
even if @var{filename} is remote, if Emacs has no network connection

lisp/files.el

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,9 +1298,14 @@ any that are missing.
12981298
IDENTIFICATION can specify which part of the identification to
12991299
return. IDENTIFICATION can be the symbol `method', `user',
13001300
`host', or `localname'. Any other value is handled like nil and
1301-
means to return the complete identification. The string returned
1302-
for IDENTIFICATION `localname' can differ depending on whether
1303-
there is an existing connection.
1301+
means to return the complete identification.
1302+
1303+
If the remote FILE does not contain a method, a user name, or a host
1304+
name, the respective default value is returned. The string returned for
1305+
IDENTIFICATION `localname' can differ depending on whether there is an
1306+
existing connection. File name handler specific implementations could
1307+
support further IDENTIFICATION symbols; Tramp, for example, knows also
1308+
the `hop' symbol.
13041309

13051310
If CONNECTED is non-nil, return an identification only if FILE is
13061311
located on a remote system and a connection is established to

0 commit comments

Comments
 (0)