mirror of https://github.com/djcb/mu.git
mu4e: better handling of closing compose frames
Use message-mode actions to close the compose frame (`mu4e-compose-in-new-frame') whenever we're finished editing a message.
This commit is contained in:
parent
ace2f2ad2c
commit
a0f0e95344
|
@ -438,7 +438,14 @@ tempfile)."
|
|||
;; hide some headers
|
||||
(mu4e~compose-hide-headers)
|
||||
;; switch on the mode
|
||||
(mu4e-compose-mode))
|
||||
(mu4e-compose-mode)
|
||||
(when mu4e-compose-in-new-frame
|
||||
;; make sure to close the frame when we're done with
|
||||
;; the message
|
||||
;; these are all buffer-local;
|
||||
(push 'delete-frame message-exit-actions)
|
||||
(push 'delete-frame message-kill-actions)
|
||||
(push 'delete-frame message-postpone-actions)))
|
||||
|
||||
(defun mu4e-sent-handler (docid path)
|
||||
"Handler function, called with DOCID and PATH for the just-sent
|
||||
|
@ -452,16 +459,8 @@ the appropriate flag at the message forwarded or replied-to."
|
|||
(dolist (buf (buffer-list))
|
||||
(when (and (buffer-file-name buf)
|
||||
(string= (buffer-file-name buf) path))
|
||||
(if (and mu4e-compose-in-new-frame (window-system))
|
||||
(progn
|
||||
(switch-to-buffer buf)
|
||||
(when (and (get-buffer-window buf)
|
||||
(window-frame (get-buffer-window buf)))
|
||||
(delete-frame (window-frame (get-buffer-window buf)))))
|
||||
)
|
||||
(if message-kill-buffer-on-exit
|
||||
(kill-buffer buf))
|
||||
))
|
||||
(kill-buffer buf))))
|
||||
;; now, try to go back to some previous buffer, in the order
|
||||
;; view->headers->main
|
||||
(if (buffer-live-p mu4e~view-buffer)
|
||||
|
|
|
@ -404,7 +404,7 @@ fields will be the same as in the original."
|
|||
|
||||
(defun mu4e~draft-open-file (path)
|
||||
"Open the the draft file at PATH."
|
||||
(if (and mu4e-compose-in-new-frame (window-system))
|
||||
(if mu4e-compose-in-new-frame
|
||||
(find-file-other-frame path)
|
||||
(find-file path)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue