From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "richard.christensen" Newsgroups: gmane.emacs.help Subject: Re: How to modify 'write-file' Date: Sun, 11 Apr 2010 16:29:57 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9f65fba7-3fba-40b6-ad86-75aa4f336b91@g11g2000yqe.googlegroups.com> References: <87ochrgpbd.fsf@galatea.lan.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273059642 7915 80.91.229.12 (5 May 2010 11:40:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 11:40:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 05 13:40:41 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9cy0-00082R-Lu for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 13:40:40 +0200 Original-Received: from localhost ([127.0.0.1]:36454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9cxz-0000Ut-T0 for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 07:40:40 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!g11g2000yqe.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-NNTP-Posting-Host: 199.3.246.231 Original-X-Trace: posting.google.com 1271028597 12973 127.0.0.1 (11 Apr 2010 23:29:57 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 11 Apr 2010 23:29:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g11g2000yqe.googlegroups.com; posting-host=199.3.246.231; posting-account=1ibdcgoAAABow1tT8596gBIVrwKkiml- User-Agent: G2/1.0 X-HTTP-Via: 1.1 ftcwebcache2.ame.avagotech.net:8088 (IronPort-WSA/6.3.0-523) X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729), gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:177678 X-Mailman-Approved-At: Tue, 04 May 2010 16:52:50 -0400 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:73393 Archived-At: On Apr 10, 12:00=A0pm, p...@informatimago.com (Pascal J. Bourguignon) wrote: > "richard.christensen" writes: > > Hi, =A0I write and modify many files with long names in which I need to > > save the changed file to a similar name as the original but with a few > > letters or numbers changed. A useful modification to write-file would > > be to have the current file name to be placed in the minibuffer along > > with the path when write-file is called. Then modifying the name would > > be simple. =A0How would I do this? =A0Ideas? > > Add the (buffer-name) as initial value to the first call to > read-file-name: > > =A0 (interactive > =A0 =A0(list (if buffer-file-name > =A0 =A0 =A0 =A0 =A0 =A0 =A0(read-file-name "Write file: " default-directo= ry > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(expand-file-n= ame > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (file-name-no= ndirectory (buffer-name)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 default-direc= tory) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0nil > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (buffer-name)= ) > =A0 =A0 =A0 =A0 =A0 =A0 =A0(read-file-name "Write file: " default-directo= ry > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(expand-file-n= ame > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (file-name-no= ndirectory (buffer-name)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 default-direc= tory) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0nil nil)) > =A0 =A0 =A0 =A0 =A0(not current-prefix-arg))) > -- > __Pascal Bourguignon__ Hi, I am missing something. When I C-x w on a buffer, I see no different behavior. The current path is there but not the buffer name. I did eval-region first. Richard