mu4e-compose: rework message-sent-hook
Grab the Fcc in the hook (when available).
This commit is contained in:
@ -548,7 +548,6 @@ appropriate flag at the message forwarded or replied-to."
|
|||||||
;; removing the In-Reply-To header.
|
;; removing the In-Reply-To header.
|
||||||
(save-restriction
|
(save-restriction
|
||||||
(message-narrow-to-headers)
|
(message-narrow-to-headers)
|
||||||
(let* ((fcc-path (message-fetch-field "Fcc")))
|
|
||||||
(when (eq mu4e-compose-type 'reply)
|
(when (eq mu4e-compose-type 'reply)
|
||||||
(unless (message-fetch-field "In-Reply-To")
|
(unless (message-fetch-field "In-Reply-To")
|
||||||
(message-remove-header "References")))
|
(message-remove-header "References")))
|
||||||
@ -560,14 +559,16 @@ appropriate flag at the message forwarded or replied-to."
|
|||||||
;; appropriate flag at the message forwarded or replied-to.
|
;; appropriate flag at the message forwarded or replied-to.
|
||||||
(add-hook 'message-sent-hook
|
(add-hook 'message-sent-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(when fcc-path ;; hmmm... #2688
|
(save-restriction
|
||||||
|
(message-narrow-to-headers)
|
||||||
|
(when-let ((fcc-path (message-fetch-field "Fcc")))
|
||||||
(mu4e--set-parent-flags fcc-path)
|
(mu4e--set-parent-flags fcc-path)
|
||||||
;; we end up with a ((buried) buffer here, visiting
|
;; we end up with a ((buried) buffer here, visiting
|
||||||
;; the fcc-path; not quite sure why. But let's
|
;; the fcc-path; not quite sure why. But let's
|
||||||
;; get rid of it (#2681)
|
;; get rid of it (#2681)
|
||||||
(when-let ((buf (find-buffer-visiting fcc-path)))
|
(when-let ((buf (find-buffer-visiting fcc-path)))
|
||||||
(kill-buffer buf))))
|
(kill-buffer buf)))))
|
||||||
nil t))))
|
nil t)))
|
||||||
|
|
||||||
;;; Crypto
|
;;; Crypto
|
||||||
(defun mu4e--compose-setup-crypto (parent compose-type)
|
(defun mu4e--compose-setup-crypto (parent compose-type)
|
||||||
|
|||||||
Reference in New Issue
Block a user