Skip to content

Commit

Permalink
Compatibility with mu4e 1.12+
Browse files Browse the repository at this point in the history
Composing and drafting were largely delegated to Gnus facilities. Code
copied from `mu4e-compose.el` is not needed.
  • Loading branch information
danielfleischer authored and jeremy-compostella committed Sep 2, 2024
1 parent 979a9f1 commit 59e2042
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions org-msg.el
Original file line number Diff line number Diff line change
Expand Up @@ -1504,33 +1504,8 @@ HTML emails."
(org-msg--mu4e-fun-call "start"))
(when mu4e-compose-complete-addresses
(org-msg--mu4e-fun-call "compose-setup-completion"))
;; the following code is verbatim from mu4e-compose.el, `mu4e-compose-mode'
;; this will setup fcc (saving sent messages) and handle flags
;; (e.g. replied to)
(add-hook 'message-send-hook
(if-let ((fun (org-msg--mu4e-fun "setup-fcc-message-sent-hook-fn")))
fun
(lambda ()
;; when in-reply-to was removed, remove references as well.
(when (eq mu4e-compose-type 'reply)
(mu4e~remove-refs-maybe))
(when use-hard-newlines
(org-msg--mu4e-fun-call "send-harden-newlines"))
;; for safety, always save the draft before sending
(set-buffer-modified-p t)
(save-buffer)
(org-msg--mu4e-fun-call "compose-setup-fcc-maybe")
(widen)))
nil t)
;; when the message has been sent.
(add-hook 'message-sent-hook
(if-let ((fun (org-msg--mu4e-fun
"set-sent-handler-message-sent-hook-fn")))
fun
(lambda ()
(setq mu4e-sent-func 'mu4e-sent-handler)
(mu4e~proc-sent (buffer-file-name))))
nil t))
(when-let ((sent-hook (org-msg--mu4e-fun "compose-before-send")))
(add-hook 'message-sent-hook sent-hook nil t)))

(defalias 'org-msg-edit-kill-buffer-mu4e 'mu4e-message-kill-buffer)

Expand Down

0 comments on commit 59e2042

Please sign in to comment.