From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#10319: 24.0.92; doc string of `file-remote-p' Date: Tue, 20 Dec 2011 10:15:29 +0100 Message-ID: <87zkend2oe.fsf@gmx.de> References: <87wr9uuvn3.fsf@gmx.de> <1C247F238CC24F6F9A0A3D077D3E09FE@us.oracle.com> <87bor5eyz0.fsf@gmx.de> <88D1EF1166814B70B0E2CD052362AA72@us.oracle.com> <87ehw0e7u0.fsf@gmx.de> <877h1sdzv0.fsf@gmx.de> <9F8218E3FA3645D9B59B2F8EEE480A8C@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1324372581 24839 80.91.229.12 (20 Dec 2011 09:16:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 20 Dec 2011 09:16:21 +0000 (UTC) Cc: 10319@debbugs.gnu.org To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 20 10:16:17 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 1Rcvny-0002pL-W0 for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Dec 2011 10:16:15 +0100 Original-Received: from localhost ([::1]:41495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcvny-0005qa-FP for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Dec 2011 04:16:14 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:50180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcvnu-0005pk-34 for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2011 04:16:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rcvnp-0004Mp-Pn for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2011 04:16:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcvnp-0004Me-N8 for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2011 04:16:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Rcvpi-0007KQ-Ec for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2011 04:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Dec 2011 09:18: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.132437265528125 (code B ref 10319); Tue, 20 Dec 2011 09:18:02 +0000 Original-Received: (at 10319) by debbugs.gnu.org; 20 Dec 2011 09:17:35 +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 1RcvpG-0007Ja-Pv for submit@debbugs.gnu.org; Tue, 20 Dec 2011 04:17:34 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1RcvpE-0007JS-L2 for 10319@debbugs.gnu.org; Tue, 20 Dec 2011 04:17:33 -0500 Original-Received: (qmail invoked by alias); 20 Dec 2011 09:15:32 -0000 Original-Received: from p57BB964B.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.150.75] by mail.gmx.net (mp064) with SMTP; 20 Dec 2011 10:15:32 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1+wJntZo3awFrdQfDyyWpj37HW7ocSCuwp+Jr5PSj UGtQ39ZUQZkrAg In-Reply-To: <9F8218E3FA3645D9B59B2F8EEE480A8C@us.oracle.com> (Drew Adams's message of "Mon, 19 Dec 2011 13:29:31 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 20 Dec 2011 04:18: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:55081 Archived-At: "Drew Adams" writes: >> The second sentence means that a relative filename like >> "/sudo::../../.." does not make sense, because it cannot >> expand out of the "/sudo::" jail. > > So what are we trying to tell _users_ here? > Is this what we are really trying to say? > > FILE must be an absolute file name. > > If so, what should we say happens if you nevertheless pass a relative > file name? Return value is unspecified (could be nil or non-nil)? An > error is raised? What should we tell users is the behavior? Any relative filename cannot expand to a different remote connection, or a filename of your local filesystem. But you are right, this information is irrelevant for the docstring of `file-remote-p'. >> > We should also perhaps say what "the complete >> > identification" is/means. IOW, when IDENTIFICATION is nil, >> > what can we say about the return value? >> >> In that case, the returned string could make a local file >> name remote. We could always offer to apply >> (concat (file-remote-p "whatever") "local-file-name") >> given that `concat' accepts nil as argument. > > Sorry, I just don't understand your reply to my question (what is the > complete identification - what is returned if IDENTIFICATION is nil). > Could you rephrase or elaborate? When IDENTIFICATION is nil, the returned string is everything until the last ":" (with expanded default method, default user, default host). (file-remote-p "/sudo::/") => "/sudo:root@localhost:" (file-remote-p "/localhost:/") => "/scpc:localhost:" What I have tried to explain is a common technique for creation of new remote filenames, derived from an existing one. Let's say you have a variable `file' containing the remote filename "/sudo::/path/to/file", and you want to create a new remote filename for the file "/bin/sh". You apply then (concat (file-remote-p file) "/bin/sh") > Thx - Drew Best reards, Michael.