From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.help Subject: Re: Saving a remote buffer into a local file Date: Wed, 25 Jan 2017 10:51:01 +0100 Message-ID: <87fuk731tm.fsf@gmx.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1485338007 17985 195.159.176.226 (25 Jan 2017 09:53:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 25 Jan 2017 09:53:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 25 10:53:22 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWKG2-0001mn-8m for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Jan 2017 10:52:50 +0100 Original-Received: from localhost ([::1]:58544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWKG7-0000Wi-F9 for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Jan 2017 04:52:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWKEZ-000835-8N for help-gnu-emacs@gnu.org; Wed, 25 Jan 2017 04:51:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWKEU-0004Vk-D9 for help-gnu-emacs@gnu.org; Wed, 25 Jan 2017 04:51:19 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:51140) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cWKEU-0004VV-2C for help-gnu-emacs@gnu.org; Wed, 25 Jan 2017 04:51:14 -0500 Original-Received: from detlef.gmx.de ([93.197.214.188]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MGFz9-1clOXA45Tz-00FFr2; Wed, 25 Jan 2017 10:51:04 +0100 In-Reply-To: (Stefan Monnier's message of "Tue, 24 Jan 2017 11:10:06 -0500") X-Provags-ID: V03:K0:8Ph+Q/rXZgrGbAMPfTyMKxjrxotekXlvpbmIrXSIWCmaRmepgaw vU7Dd9pZIVJHczwBX1kanW3qfK9+6tCtdV/1GAkgrQBumghR+NOYTekSlMjYwOzhkmGEchF 2PTdjwkLAqpOiqFbhMgXidt1x77WxbRQhhZpxB09+wbabrR99f/2gwy0iSRq4a0i9PWl++F Hvpw4VCy1mnBQfb85nGlA== X-UI-Out-Filterresults: notjunk:1;V01:K0:3r/mJXdogCI=:BP3D6cudF2PmXm2fTAY2Do 2ZzOh2TCNWyDHhXkwi/lDqVwshJ51xyGmfrFwhLyTgEz2BpJKcpSgRgxWCyuxpZolFhoHesl/ Iwq/4t1QxqH++2lWy4US5/GeYxojRxtkTiwLqCnhaIaT5RZpTE5et0EmEUbXup6JurRlHgjdX 2rPETZEuLGUpFs1kE/sJWrrJKPZyt9F80I4aNiIbJCvdMi5QGtv8ILsTkQKV+ZIF0F6xIw/WN 64R+GmHFS72x7MBh7+0TBu8YqG3jC0dshTFP10ZzMztfSkJ8imRHHXsn3E5VIPx+UZK7XMQJa 0mVxOk9UfN2cp5SPlR/mvS+YsuDuyGY77CfDUmFNu2ODTwM9kXKXxbp874DjwHcFCDL88whnp Z1g72glbgqlmEU/iWNHD9hz7AYuxf+Q7KQEI20uIgWhODB1AvI4c4lo+caCmjI8/mw3KjBQLi EWA+kThttfNEPT/YZZy+Fs0zwtcFbFb8D0aWzuhCMUvKrS++QyfhUV2OXUqHwOGF3OMtDNMs/ MT9V1JPM+toQBA9IfAmT3CodVSuGHJ8AkT8dBs++jkpbxAfjPtk/wlPTiS2svOREWQlDW/Ows MxU/0oNwbEFKWEp0sYRoarJ63pF8fIJxZ3R5ENV/4+kEEQF3NFFn2zP+2XRU5rxyUuFlynTaI 0M8D+7Go8+dc9AT4PDObNGetR9m6x5i4OO+WYZBQMM+6JtajI1JIF725Wz8/SwuwYTa+gtpn5 Zq+Oz9Q6iaNrIMneK5Yrya91ukMp6425kqe6k+My6bv/ATQo8IvbCPxy7wmfOkABYdWZVRLT X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.22 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112160 Archived-At: Stefan Monnier writes: >> Suppose I visit some remote file: >> C-x C-f /ssh:user1@host1:/path1/file1 >> Now, I want to save the resulting buffer into a local file. Doing: >> C-x C-w ~/file2 >> does not work, since in will create a file in the remote host (host1). > > It works for me if I add a "C-a C-k": > > C-x C-w C-a C-k ~/file2 > > Yet, if I do like you suggest, I see a bug: while typing "~/file2" the > leading "/ssh:user1@host1:/path1/" text is greyed out, giving the > incorrect impression that it won't be used. No. Only "/path1/" is greyed out, telling you that *this* part won't be used. Remote file names have a special meaning of double slash and slash tilde in file name completion. It removes the leading part of the remote file name's local part. You need another slash for removing the whole file name in the minibuffer. Therefore, doing C-x C-w /~/file2 would suffice. You will see also the grey part of the minibuffer being changed to the whole line. Personally, when I want to save a remote file locally, I have the attitude typing three slashes first. Meanwhile, I do this even w/o thinking about :-) See (info "(tramp) File name completion") for discussion. > Stefan Best regards, Michael.