mu4e: fix compose cancel orphaning a buffer

Create buffer contents _before_ creating the file.
This commit is contained in:
Thomas Moulia 2016-01-31 21:48:41 -08:00 committed by djcb
parent 29a4ae1c83
commit 8f5df6cca0
1 changed files with 11 additions and 10 deletions

View File

@ -430,17 +430,18 @@ from either `mu4e~draft-reply-construct', or
(format "%s/%s/cur/%s"
mu4e-maildir
draft-dir
(mu4e~draft-message-filename-construct "DS"))))
(if (and mu4e-compose-in-new-frame (window-system))
(mu4e~draft-message-filename-construct "DS")))
(initial-contents
(case compose-type
(reply (mu4e~draft-reply-construct msg))
(forward (mu4e~draft-forward-construct msg))
(new (mu4e~draft-newmsg-construct))
(t (mu4e-error "unsupported compose-type %S" compose-type)))))
(if (and mu4e-compose-in-new-frame (window-system))
(find-file-other-frame draft-path)
(find-file draft-path)))
(insert
(case compose-type
(reply (mu4e~draft-reply-construct msg))
(forward (mu4e~draft-forward-construct msg))
(new (mu4e~draft-newmsg-construct))
(t (mu4e-error "unsupported compose-type %S" compose-type))))
(newline)
(find-file draft-path))
(insert initial-contents))
(newline)
;; include the message signature (if it's set)
(if (and mu4e-compose-signature-auto-include mu4e-compose-signature)
(let ((message-signature mu4e-compose-signature))