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: Tue, 03 Jan 2006 11:16:19 +0100 Message-ID: <87acedd3bg.fsf@hans.local.net> References: <87u0cmclgy.fsf@hans.local.net> <8764p22d9j.fsf@gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1136295814 24229 80.91.229.2 (3 Jan 2006 13:43:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 3 Jan 2006 13:43:34 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 03 14:43:31 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 1EtmRe-0001m3-1j for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Jan 2006 14:43:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EtmTG-00037T-J7 for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Jan 2006 08:45:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EtkOH-00060O-50 for help-gnu-emacs@gnu.org; Tue, 03 Jan 2006 06:31:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EtkKa-0004jB-Jp for help-gnu-emacs@gnu.org; Tue, 03 Jan 2006 06:29:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Etjk0-0001ek-7w for help-gnu-emacs@gnu.org; Tue, 03 Jan 2006 05:50:14 -0500 Original-Received: from [212.227.126.187] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EtjlD-0004uN-2w for help-gnu-emacs@gnu.org; Tue, 03 Jan 2006 05:51:23 -0500 Original-Received: from [84.167.36.7] (helo=duenenhof-wilhelm.de) by mrelayeu.kundenserver.de (node=mrelayeu3) with ESMTP (Nemesis), id 0MKxQS-1EtjiK462h-0000lL; Tue, 03 Jan 2006 11:48:25 +0100 Original-Received: by duenenhof-wilhelm.de (Postfix, from userid 1000) id D7E8E4ED28; Tue, 3 Jan 2006 11:16:19 +0100 (CET) Original-To: Ian Zimmerman In-Reply-To: <8764p22d9j.fsf@gmail.com> (Ian Zimmerman's message of "Mon, 02 Jan 2006 19:37:02 -0800 (PST)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-Provags-ID: kundenserver.de abuse@kundenserver.de login:d7ab225b98a136e1c2910381f940ecb9 X-Mailman-Approved-At: Tue, 03 Jan 2006 07:54:41 -0500 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:32372 Archived-At: Ian Zimmerman writes: > Dieter> Every so often I'm working on a file whose name I've not chosen > Dieter> appropriately. So far I couldn't find an elegant way in Emacs to > Dieter> rename the file and the buffer at the same time. I found the function > Dieter> definitions below in the net, which serve my needs perfectly, but I'm > Dieter> wondering whether I've overlooked something equally fitting from standard > Dieter> emacs packages? What are you doing in this situation? Yes I know: > Dieter> Thinking in advance, but ... > > 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. > It does have the side effect of saving the buffer at that time, sorry if > that's not what you want. Thank you for your reply. I'm new to newsgroups, may I ask why you've written to my email address directly and copied your message to `help-gnu-emacs@gnu.org', isn't it usual posting directly (and solely) to the newsgroup? -- Best wishes Dieter Wilhelm