[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to modify 'write-file'
From: |
Pascal J. Bourguignon |
Subject: |
Re: How to modify 'write-file' |
Date: |
Tue, 04 May 2010 15:44:18 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (darwin) |
"richard.christensen" <richard.christensen@avagotech.com> writes:
> Hi, I 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. How would I do this? Ideas?
Add the (buffer-name) as initial value to the first call to
read-file-name:
(interactive
(list (if buffer-file-name
(read-file-name "Write file: " default-directory
(expand-file-name
(file-name-nondirectory (buffer-name))
default-directory)
nil
(buffer-name))
(read-file-name "Write file: " default-directory
(expand-file-name
(file-name-nondirectory (buffer-name))
default-directory)
nil nil))
(not current-prefix-arg)))
--
__Pascal Bourguignon__
- How to modify 'write-file', richard.christensen, 2010/05/04
- Re: How to modify 'write-file',
Pascal J. Bourguignon <=
- Re: How to modify 'write-file', richard.christensen, 2010/05/04
- Re: How to modify 'write-file', richard.christensen, 2010/05/04
- Re: How to modify 'write-file', Pascal J. Bourguignon, 2010/05/04
- Re: How to modify 'write-file', richard.christensen, 2010/05/04
- Re: How to modify 'write-file', Pascal J. Bourguignon, 2010/05/04
- Re: How to modify 'write-file', richard.christensen, 2010/05/04
- Re: How to modify 'write-file', Kevin Rodgers, 2010/05/06
- Re: How to modify 'write-file', Thierry Volpiatto, 2010/05/07
Re: How to modify 'write-file', Andreas Politz, 2010/05/04