From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.devel Subject: Re: Remove the magic portion of a remote file name Date: Wed, 16 Apr 2014 17:52:57 +0300 Message-ID: References: <66E6635733884E56A1359EAADADF5763@gmail.com> <871twxpdnx.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1133177c7a2a0804f72a12e8 X-Trace: ger.gmane.org 1397659994 21968 80.91.229.3 (16 Apr 2014 14:53:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Apr 2014 14:53:14 +0000 (UTC) Cc: emacs-devel To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 16 16:53:07 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WaRD0-0002UR-EC for ged-emacs-devel@m.gmane.org; Wed, 16 Apr 2014 16:53:06 +0200 Original-Received: from localhost ([::1]:54992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaRCz-000233-Qn for ged-emacs-devel@m.gmane.org; Wed, 16 Apr 2014 10:53:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaRCw-00022r-80 for emacs-devel@gnu.org; Wed, 16 Apr 2014 10:53:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WaRCs-0008Gv-Fm for emacs-devel@gnu.org; Wed, 16 Apr 2014 10:53:02 -0400 Original-Received: from mail-oa0-x22a.google.com ([2607:f8b0:4003:c02::22a]:43475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaRCs-0008Fu-Ak for emacs-devel@gnu.org; Wed, 16 Apr 2014 10:52:58 -0400 Original-Received: by mail-oa0-f42.google.com with SMTP id i4so12644730oah.29 for ; Wed, 16 Apr 2014 07:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=1UUbK2IfGrTDt5FV0DX5IDYHYQ7geWPO6IRrY1Nx5A0=; b=SrbdcMMvUp8tWz7Gt6+JeisC7e4PNmI8CoaY6UYTvryHZ0ZRhGaA7kS8IKc0tfEPsj CWQJWhYNResZACLCW7TbdEEh98gLz2UmfD2/yPWM+6D1s+0x/hzzDNcZCSKvOrRjayBK 990FlgH4s69VxW5e8OKTY/eYodFL/vkputllY6KkuIWicOMQfGm1Jmf5W4ipcHe764gE UH/LUdiVWEY/8YiEZdxsG8B3gahmGxAmtgbunmgWDtIn0K6fhnE8yOZuRvrwIVzZe5lx 4r3N7xW2Xmy+brFLqPXPOqohz+KzUTQUJ1U8yW91Z0AwRwnNCPZMJ6mPJug4YASiG4lX QwMg== X-Received: by 10.182.22.33 with SMTP id a1mr2183541obf.60.1397659977524; Wed, 16 Apr 2014 07:52:57 -0700 (PDT) Original-Received: by 10.76.101.12 with HTTP; Wed, 16 Apr 2014 07:52:57 -0700 (PDT) In-Reply-To: <871twxpdnx.fsf@gmx.de> X-Google-Sender-Auth: bh5h7_k4lz2aGiWJ8bwgvbKbWJM X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::22a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171456 Archived-At: --001a1133177c7a2a0804f72a12e8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks, Michael! I guess I didn't expect that a function with a predicate name would do something like that. :-) On 16 April 2014 17:11, Michael Albinus wrote: > Bozhidar Batsov writes: > > > Hi guys, > > Hi Bozhidar, > > > I wonder what's the authoritative way to obtain the local file name > > portion > > of a remote file name? I=E2=80=99m looking for a function that would tu= rn > > "/ssh:root@192.168.1.1:/some/path/file" into "/some/path/file". > > (file-remote-p "/ssh:root@192.168.1.1:/some/path/file" 'localname) > > > I know of `tramp-dissect-file-name', but I wonder if there's a better > > way, that doesn=E2=80=99t involve requiring tramp. > > Internally, it could use Tramp, but you don't need to require it. > > Best regards, Michael. > --001a1133177c7a2a0804f72a12e8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks, Michael! I guess I didn't expect that a functi= on with a predicate name would do something like that. :-)


On 16 April 2014 17:11,= Michael Albinus <michael.albinus@gmx.de> wrote:
Bozhidar Batsov <bozhidar@batsov.com> writes:

> Hi guys,

Hi Bozhidar,

> I wonder what's the authoritative way to obtain the local file nam= e
> portion
> of a remote file name? I=E2=80=99m looking for a function that would t= urn
> "/ssh:root@192.168.1.1:/some/path/file" into "/some/pat= h/file".

(file-remote-p "/ssh:root@192.168.1.1:/some/path/file" '= ;localname)

> I know of `tramp-dissect-file-name', but I wonder if there's a= better
> way, that doesn=E2=80=99t involve requiring tramp.

Internally, it could use Tramp, but you don't need to require it.=

Best regards, Michael.

--001a1133177c7a2a0804f72a12e8--