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 11:16:00 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0a5b2aeb-48d5-46e7-ae0e-67f9a966ce35@x3g2000yqd.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 1273059285 6586 80.91.229.12 (5 May 2010 11:34:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 11:34:45 +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:34:43 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 1O9csE-0004ga-C3 for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 13:34:42 +0200 Original-Received: from localhost ([127.0.0.1]:44511 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9csD-0003L2-BA for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 07:34:41 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!x3g2000yqd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-NNTP-Posting-Host: 199.3.246.231 Original-X-Trace: posting.google.com 1271009760 24828 127.0.0.1 (11 Apr 2010 18:16:00 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 11 Apr 2010 18:16:00 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x3g2000yqd.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:177672 X-Mailman-Approved-At: Tue, 04 May 2010 16:52:35 -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:73390 Archived-At: Thanks. I'll give this a try. 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__