I am using emacs for writing email with mutt. Email are stored in /tmp even after I sent them (until /tmp is cleared). Since I start emacs with emacs--daemon, I have all the emails I have written during the session opened as buffers when launching emacsclient.

I don't like this behavior. I would like emacs to kill the opened buffer when C-c C-x is pressed (and to not have this buffer charged when open a new window of emacs with emacsclient.

How can I do this?

1 Answer 1


Make sure server-kill-new-buffers is t (the default) and finish editing with C-x # instead of C-c C-x.

This calls server-edit. I cite the relevant part of it's doc string here:

Switch to next server editing buffer; say "Done" for current buffer. If a server buffer is current, it is marked "done" and optionally saved. The buffer is also killed if it did not exist before the clients asked for it. When all of a client’s buffers are marked as "done", the client is notified.

If there just one buffer associated with the client that buffer is killed and the terminal of the client is closed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.