From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#10319: 24.0.92; doc string of `file-remote-p' Date: Mon, 19 Dec 2011 11:44:16 -0800 Message-ID: References: <87wr9uuvn3.fsf@gmx.de><1C247F238CC24F6F9A0A3D077D3E09FE@us.oracle.com><87bor5eyz0.fsf@gmx.de><88D1EF1166814B70B0E2CD052362AA72@us.oracle.com> <87ehw0e7u0.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1324323918 31202 80.91.229.12 (19 Dec 2011 19:45:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 19 Dec 2011 19:45:18 +0000 (UTC) Cc: 10319@debbugs.gnu.org To: "'Michael Albinus'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 19 20:45:14 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rcj97-0003g4-Mn for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Dec 2011 20:45:13 +0100 Original-Received: from localhost ([::1]:57065 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcj97-00070W-8G for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Dec 2011 14:45:13 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:43199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcj94-0006zY-AK for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2011 14:45:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rcj93-0002O6-2a for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2011 14:45:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcj92-0002N2-S6 for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2011 14:45:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RcjAr-00053c-W4 for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2011 14:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Dec 2011 19:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10319 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10319-submit@debbugs.gnu.org id=B10319.132432397719389 (code B ref 10319); Mon, 19 Dec 2011 19:47:01 +0000 Original-Received: (at 10319) by debbugs.gnu.org; 19 Dec 2011 19:46:17 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RcjA9-00052f-DF for submit@debbugs.gnu.org; Mon, 19 Dec 2011 14:46:17 -0500 Original-Received: from acsinet15.oracle.com ([141.146.126.227]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RcjA5-00052X-W7 for 10319@debbugs.gnu.org; Mon, 19 Dec 2011 14:46:15 -0500 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pBJJiHHj010589 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 19 Dec 2011 19:44:18 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id pBJJiH9k024044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Dec 2011 19:44:17 GMT Original-Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id pBJJiGD3012965; Mon, 19 Dec 2011 13:44:16 -0600 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 19 Dec 2011 11:44:16 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87ehw0e7u0.fsf@gmx.de> Thread-Index: Acy+e8AYuCUwGeSORW+RuuUr1vxYJwAB4YCQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4EEF9412.010B,ss=1,re=0.000,fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 19 Dec 2011 14:47:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:55072 Archived-At: > > 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@host:/foo" could be "/user@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@host:/foo" could be "/user@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