From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dieter Wilhelm Newsgroups: gmane.emacs.help Subject: Re: renaming current file and buffer Date: Wed, 04 Jan 2006 00:51:25 +0100 Message-ID: <87k6dg7tvm.fsf@hans.local.net> References: <87u0cmclgy.fsf@hans.local.net> <8764p22d9j.fsf@gmail.com> <87acedd3bg.fsf@hans.local.net> <4078D06C-770A-46C1-9E50-8E5853409B25@Web.DE> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1136332411 29225 80.91.229.2 (3 Jan 2006 23:53:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 3 Jan 2006 23:53:31 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 04 00:53:20 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Etvxs-0000M3-Dl for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Jan 2006 00:53:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EtvzW-0001eH-5r for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Jan 2006 18:54:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EtvyI-0001Hl-H8 for help-gnu-emacs@gnu.org; Tue, 03 Jan 2006 18:53:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EtvyG-0001Gp-Pl for help-gnu-emacs@gnu.org; Tue, 03 Jan 2006 18:53:41 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EtvyG-0001Gc-DW for help-gnu-emacs@gnu.org; Tue, 03 Jan 2006 18:53:40 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1EtvzZ-0002q0-6C for help-gnu-emacs@gnu.org; Tue, 03 Jan 2006 18:55:01 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EtvwT-0008Rn-Li for help-gnu-emacs@gnu.org; Wed, 04 Jan 2006 00:51:49 +0100 Original-Received: from p54a7456f.dip0.t-ipconnect.de ([84.167.69.111]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Jan 2006 00:51:49 +0100 Original-Received: from dieter by p54a7456f.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Jan 2006 00:51:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 35 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: p54a7456f.dip0.t-ipconnect.de User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:z7k8a+B5mU7nLPzK+Wz8vdYnY3A= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:32397 Archived-At: Peter Dyballa writes: > Am 03.01.2006 um 11:16 schrieb Dieter Wilhelm: > >>> Doesn't C-x C-w (`write-file') work for you? >> >> Agreed, write-file gives me the opportunity for choosing another name >> (with the corresponding buffer name). But then I'd have to kill >> the badly >> named file in a second step (e.g. in a dired buffer) since the old, >> now redundant file remains on the file system. > > I now remember how I handle this: I rename in dired-mode the file I > am editing (having it saved before). The buffer name follows this > change after some time. Knowing the behaviour of `rename-file' (not changing the buffer name) I was somehow prejudiced against testing this possibility with dired. But it actually works, thanks a lot for this hint! With the standard dired it's a tad slow albeit. It means getting into dired (C-x 4 d, lest I don't forget the filename), then looking for the file (possibly searching with C-s). This might, just might justify the hassle of using a home-made function. But with the dired-x package - I just discovered - its working like a charm. Just typing C-x C-j in the respective buffer is getting one into a dired buffer with point already at the corresponding file! Then R NEW-NAME RET RET and here we are again. Great stuff -- Best wishes Dieter Wilhelm