Web lists-archives.com

Emacs and message-mode: save and close buffer




I have this code in my .emacs to save and close the buffer with C-c C-c.
It is designed to use with message-mode for going back to mutt after
writing an email.

However, it doesn't save the buffer. If I compose an email and never
press C-x C-s, C-c C-c will just close the buffer and erase it with
nothing left to send. Pretty annoying!

       (add-hook
        'message-mode-hook
        (lambda ()
         (define-key mail-mode-map [(control c) (control c)]
           (lambda ()
            (interactive)
            (save-buffer)
            (server-edit)))))

What can I change?