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 18:02:57 +0100 Message-ID: <87ehvzch1a.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> <87zkend2oe.fsf@gmx.de> <7ED9EAB31656456981FDB12C5ABD0C7B@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1324400663 858 80.91.229.12 (20 Dec 2011 17:04:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 20 Dec 2011 17:04:23 +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 18:04:19 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 1Rd36x-0007dp-5H for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Dec 2011 18:04:19 +0100 Original-Received: from localhost ([::1]:57137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd36w-0006pS-FR for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Dec 2011 12:04:18 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:57614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd36p-0006ou-7A for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2011 12:04:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rd36h-0000aZ-Jl for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2011 12:04:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd36h-0000aO-I5 for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2011 12:04:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Rd38b-0001rT-V1 for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2011 12:06:01 -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 17:06: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.13244007087091 (code B ref 10319); Tue, 20 Dec 2011 17:06:01 +0000 Original-Received: (at 10319) by debbugs.gnu.org; 20 Dec 2011 17:05:08 +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 1Rd37j-0001qJ-Uo for submit@debbugs.gnu.org; Tue, 20 Dec 2011 12:05:08 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Rd37g-0001qA-4K for 10319@debbugs.gnu.org; Tue, 20 Dec 2011 12:05:06 -0500 Original-Received: (qmail invoked by alias); 20 Dec 2011 17:03:01 -0000 Original-Received: from p57BB964B.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.150.75] by mail.gmx.net (mp015) with SMTP; 20 Dec 2011 18:03:01 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX19Bh9JkKGpBZ115qsnc3kQk6rFr9P2z1xFWsrea4I /vO4oEqbgvWs5b In-Reply-To: <7ED9EAB31656456981FDB12C5ABD0C7B@us.oracle.com> (Drew Adams's message of "Tue, 20 Dec 2011 07:53:24 -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 12:06: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:55085 Archived-At: "Drew Adams" writes: > Are you saying that nil is always returned for a relative file name? If so, > let's just say that: "Return nil if FILE is a relative file name". (No need to > say that you must or should use an absolute name.) Thinking about (and testing a little bit) it seems like this: for relative file names it always returns nil, indeed. This is because it does not apply `expand-file-name'. Your proposed sentence looks OK. >> 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:" > > Fine. Let's say that (it's not obvious, IMHO). > > When IDENTIFICATION is nil, the returned string is a complete > remote identifier: with components method, user, and host. > The components are those present in FILE, with defaults filled > in for any that are missing. OK. >> 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") > > That's a useful tip about another way to _use_ the function, and also not so > obvious. Let's say that too. > > Tip: You can use this expansion of remote identifier components > to derive a new remote name from an existing one. For example, > if FILE is "/sudo::/path/to/file" then > (concat (file-remote-p FILE) "/bin/sh") returns a remote > name for file "/bin/sh" that has the same remote identifier as > FILE but expanded; a name such as "/sudo:myhost.org:/bin/sh". OK as well. Minor change: the result for the sudo case ought to be "/sudo:root@myhost:/bin/sh". "root" is the default user name for "sudo", and "myhost" instead of "myhost.org" because the default host name in this case is the value of `system-name'. > HTH. Thanks, and best regards, Michael.