mu4e: fix compose cancel orphaning a buffer
Create buffer contents _before_ creating the file.
This commit is contained in:
@ -430,17 +430,18 @@ from either `mu4e~draft-reply-construct', or
|
|||||||
(format "%s/%s/cur/%s"
|
(format "%s/%s/cur/%s"
|
||||||
mu4e-maildir
|
mu4e-maildir
|
||||||
draft-dir
|
draft-dir
|
||||||
(mu4e~draft-message-filename-construct "DS"))))
|
(mu4e~draft-message-filename-construct "DS")))
|
||||||
(if (and mu4e-compose-in-new-frame (window-system))
|
(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-other-frame draft-path)
|
||||||
(find-file draft-path)))
|
(find-file draft-path))
|
||||||
(insert
|
(insert initial-contents))
|
||||||
(case compose-type
|
(newline)
|
||||||
(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)
|
|
||||||
;; include the message signature (if it's set)
|
;; include the message signature (if it's set)
|
||||||
(if (and mu4e-compose-signature-auto-include mu4e-compose-signature)
|
(if (and mu4e-compose-signature-auto-include mu4e-compose-signature)
|
||||||
(let ((message-signature mu4e-compose-signature))
|
(let ((message-signature mu4e-compose-signature))
|
||||||
|
|||||||
Reference in New Issue
Block a user