GNU bug report logs -
#10319
24.0.92; doc string of `file-remote-p'
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Sun, 18 Dec 2011 02:20:01 UTC
Severity: minor
Found in version 24.0.92
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> > That might be worth pointing out in the doc string. It might be
> > useful to users of the function. Perhaps you could just add
> > text like this:
> > "The return value can differ depending on whether there
> > is an existing connection."
>
> We shall mention that the return value is still a string. And the
> difference happens only for localname parts.
Good.
> > Do we want to say more than that? Is there some rule about this?
> > E.g., if no existing connection is the return value _always_ ""? If
> > no rule, then just adding that sentence (or similar) should
> > be enough.
>
> I wouldn't give a rule. There are other cases, like (file-remote-p
> "/ssh::" 'localname), which returns "~" when there is no
> connection, and "/home/albinus" otherwise.
>
> Combining your proposals, the docstring could be
>
> "Test whether FILE specifies a location on a remote system. Returns
> nil or a string
Returns -> Return. I think that's the convention, but I'm no expert.
> identifying the remote connection (ideally a prefix
> of FILE). For example, the remote identification for filename
> "/user <at> host:/foo" could be "/user <at> host:".
> A file is considered "remote" if accessing it is likely to
> be slower or less reliable than accessing local files.
I'd suggest moving that just after the first sentence ("Test...").
> Furthermore, relative file names do not work across remote
> connections.
Why "Furthermore"? This seems unrelated to anything preceding it. If I'm
right, I'd suggest just dropping "Furthermore". But in fact I don't know what
this sentence means. What do you mean here by "do not work"?
> IDENTIFICATION specifies which part of the identification shall be
> returned as string.
shall be returned as string -> to return
> IDENTIFICATION can be the symbol `method',
> `user', `host' or `localname'; any other value is handled like nil
> and means to return the complete identification string.
No need for "string" here.
> The string
> returned for IDENTIFICATION `localname' can differ depending on
> whether there is an existing connection."
Good.
> If CONNECTED is non-nil, the function returns an
the function returns -> return
> identification only if FILE is located on a remote system,
No comma here.
> and a connection is established to that remote system.
> `file-remote-p' never opens a new remote connection. It can only
> reuse a connection that is already open."
I'd suggest putting that last part just after "A file is considered remote
if..."
Something like this (but see my question about relative file names not working):
Test whether FILE specifies a location on a remote system.
A file is considered remote if accessing it is likely to
be slower or less reliable than accessing local files.
`file-remote-p' never opens a new remote connection. It can
only reuse a connection that is already open. Relative file
names do not work across remote connections (????).
Return nil or a string identifying the remote connection
(ideally a prefix of FILE). For example, the remote
identification for filename "/user <at> host:/foo" could be
"/user <at> host:".
IDENTIFICATION specifies which part of the identification to
return. IDENTIFICATION can be the symbol `method',
`user', `host', or `localname'. Any other value is handled
like nil and means to return the complete identification.
The string returned for IDENTIFICATION `localname' can differ
depending on whether there is an existing connection."
If CONNECTED is non-nil, return an identification only
if FILE is located on a remote system and a connection is
established to that remote system.
We should also perhaps say what "the complete identification" is/means. IOW,
when IDENTIFICATION is nil, what can we say about the return value?
HTH - Drew
This bug report was last modified 13 years and 214 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.