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 08:10:47 -0800 Message-ID: <88D1EF1166814B70B0E2CD052362AA72@us.oracle.com> References: <87wr9uuvn3.fsf@gmx.de><1C247F238CC24F6F9A0A3D077D3E09FE@us.oracle.com> <87bor5eyz0.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 1324311086 28724 80.91.229.12 (19 Dec 2011 16:11:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 19 Dec 2011 16:11:26 +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 17:11:22 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 1Rcfo6-0004j3-R4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Dec 2011 17:11:19 +0100 Original-Received: from localhost ([::1]:33175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcfo6-0006DR-A5 for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Dec 2011 11:11:18 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:55345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcfo3-0006DK-K7 for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2011 11:11:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rcfnx-0000B4-M6 for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2011 11:11:15 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcfnx-0000Aw-KV for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2011 11:11:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Rcfpm-0008JO-9e for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2011 11:13: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 16:13:02 +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.132431117831941 (code B ref 10319); Mon, 19 Dec 2011 16:13:02 +0000 Original-Received: (at 10319) by debbugs.gnu.org; 19 Dec 2011 16:12:58 +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 1Rcfpi-0008J7-5T for submit@debbugs.gnu.org; Mon, 19 Dec 2011 11:12:58 -0500 Original-Received: from acsinet15.oracle.com ([141.146.126.227]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Rcfpf-0008Ix-TR for 10319@debbugs.gnu.org; Mon, 19 Dec 2011 11:12:56 -0500 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pBJGB0FA026444 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 19 Dec 2011 16:11:01 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id pBJGAxpF003558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Dec 2011 16:10:59 GMT Original-Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id pBJGAw48021800; Mon, 19 Dec 2011 10:10:58 -0600 Original-Received: from dradamslap1 (/10.159.51.27) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 19 Dec 2011 08:10:58 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87bor5eyz0.fsf@gmx.de> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Acy+KdtaHsJYlG5+TlCcQJ+tfsf2xAAPTLrw X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090202.4EEF6215.00EF,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 11:13:02 -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:55065 Archived-At: > > Do you just want to say that `file-remote-p' never opens > > a new connection (i.e., a connection that is not already > > established/open)? > > Yes. > > > If so, let's just say that: It never opens a new remote > > connection. It can only reuse a connection that is > > already open. > > Sounds OK to me. Let's do that then. IMO, that will avoid some misunderstanding. > > Can the handler establish a _new_ connection? If so, then > > `file-remote-p' can do so. If not, then can't we just say > > that `file-remote-p' never establishes (opens) a new > > connection? > > It is a promise to libraries using `file-remote-p'. It is guaranteed > that the function call is cheap, and that it could be used here and > there w/o remarkable overhead. That is covered by what is said above: it never opens new connection. > It is also an implementation hint. Any handler that provides an own > implementation of `file-remote-p' shall behave like this. > `tramp-handle-file-remote-p' and `ange-ftp-file-remote-p' do so. I doubt that trying to hint that in the doc string will help more than hurt user understanding. IMO we would either need to spell that out clearly or put it in comments in the code. I think the latter is preferable. The doc string should be aimed mainly at users of the function, not at implementors of substitute definitions of it. But all of that kind of thing can be stated clearly in the source file for those to whom it is useful. > As a consequence, the result might differ whether a connection is > already open, or not. If the connection is not established yet, we get > (file-remote-p "/ssh::" 'localname) => "" > If there is an established connection, we see > (file-remote-p "/ssh::" 'localname) => "/home/albinus" 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." 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. Thx - Drew