Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Yes, see this answer on – Luke Girvin Nov 26 '11 at 20:36
Yes, that's the one I want! Tnx. – Michiel Borkent Nov 26 '11 at 20:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.