From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Zimmerman Newsgroups: gmane.emacs.help Subject: Re: renaming current file and buffer Date: Mon, 02 Jan 2006 19:37:02 -0800 (PST) Message-ID: <8764p22d9j.fsf@gmail.com> References: <87u0cmclgy.fsf@hans.local.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1136259518 26124 80.91.229.2 (3 Jan 2006 03:38:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 3 Jan 2006 03:38:38 +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 04:38:37 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 1Etd0O-00063d-CA for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Jan 2006 04:38:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Etd1z-0006rL-O7 for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Jan 2006 22:40:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Etd0Z-0005xA-5v for help-gnu-emacs@gnu.org; Mon, 02 Jan 2006 22:38:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Etd0X-0005tp-39 for help-gnu-emacs@gnu.org; Mon, 02 Jan 2006 22:38:46 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Etd0W-0005te-VF for help-gnu-emacs@gnu.org; Mon, 02 Jan 2006 22:38:44 -0500 Original-Received: from [64.233.184.205] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Etd1g-0001Xa-Ms for help-gnu-emacs@gnu.org; Mon, 02 Jan 2006 22:39:56 -0500 Original-Received: by wproxy.gmail.com with SMTP id 58so2050651wri for ; Mon, 02 Jan 2006 19:37:02 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:to:cc:subject:references:from:in-reply-to:message-id:lines:user-agent:mime-version:content-type:date; b=DuCz0uwRjBzN1DFYMMUXgftjCZTqzn3v6BQUGCApUXXR/9mhAtMQU3O2Xug1ZCAcPPxmgRsf7b9AYZA9JXq2t6jqjVrsn8pFKM84t5kCaKc9Pkv59QfDobsedEB8IdwJE0obQ3kClpnVpRlTHBXif0k30UBNq0K8o1wQ5Gy42Hk= Original-Received: by 10.54.158.16 with SMTP id g16mr797532wre; Mon, 02 Jan 2006 19:36:33 -0800 (PST) Original-Received: from unicorn ( [72.60.106.112]) by mx.gmail.com with ESMTP id 6sm14950842wrl.2006.01.02.19.37.02; Mon, 02 Jan 2006 19:37:02 -0800 (PST) Original-Received: from itz by unicorn with local (Exim 4.60) (envelope-from ) id 1Etcym-0001CL-A6; Mon, 02 Jan 2006 22:36:56 -0500 Original-To: Dieter Wilhelm In-Reply-To: <87u0cmclgy.fsf@hans.local.net> Original-Lines: 15 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 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:32366 Archived-At: 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? It does have the side effect of saving the buffer at that time, sorry if that's not what you want. -- A true pessimist won't be discouraged by a little success.