Is it possible in Emacs to save a buffer to a different filename than the currently associated filename and to remove the file with the current filename?

For example, I'm editing file1.txt in a buffer. I would like to save this as file2.txt and want file1.txt to be deleted.

So just like "save as" in most programs, but with the extra removal.

I could write a function for this, but I'm wondering if something like this already exists in Emacs.

link|improve this question

38% accept rate
1  
Yes, see this answer on stackoverflow.com: stackoverflow.com/q/384346/133 – Luke Girvin Nov 26 '11 at 20:36
Yes, that's the one I want! Tnx. – Michiel Borkent Nov 26 '11 at 20:43
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.