From fa2427e6f9248ed5bc8d0ee16cc3d6474f852e4b Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Thu, 9 Jun 2016 07:22:56 +0200 Subject: [PATCH] Fix window restoration when C-g'ing on reply. * mu4e/mu4e-compose.el (mu4e~compose-handler): Save and restore window config. --- mu4e/mu4e-compose.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index ceacd337..ddc70f97 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -484,10 +484,12 @@ tempfile)." (run-hooks 'mu4e-compose-pre-hook) ;; this opens (or re-opens) a messages with all the basic headers set. - (condition-case nil - (mu4e-draft-open compose-type original-msg) - (quit (kill-buffer) (mu4e-message "Operation aborted") - (return-from mu4e~compose-handler))) + (let ((winconf (current-window-configuration))) + (condition-case nil + (mu4e-draft-open compose-type original-msg) + (quit (set-window-configuration winconf) + (mu4e-message "Operation aborted") + (return-from mu4e~compose-handler)))) ;; insert mail-header-separator, which is needed by message mode to separate ;; headers and body. will be removed before saving to disk (mu4e~draft-insert-mail-header-separator)