mu4e-compose: include references / in-reply-to

For replies and forwarded messages.
This commit is contained in:
Dirk-Jan C. Binnema 2023-11-02 22:21:10 +02:00
parent 5b29ad8b6d
commit 541c818a9f
2 changed files with 12 additions and 10 deletions

View File

@ -666,18 +666,20 @@ PARENT is the \"parent\" message; nil
(message-required-mail-headers (message-required-mail-headers
(seq-filter #'identity ;; ensure needed headers are generated. (seq-filter #'identity ;; ensure needed headers are generated.
`(From Subject Date Message-ID `(From Subject Date Message-ID
,(when (eq mu4e-compose-type 'reply) 'In-Reply-To) ,(when (eq mu4e-compose-type 'reply) 'In-Reply-To)
,(when (memq mu4e-compose-type '(reply forward))
'References))
;; XXX vvv these two don't work. why not? ;; XXX vvv these two don't work. why not?
;; ,(when message-newsreader 'User-Agent) ;; ,(when message-newsreader 'User-Agent)
;; ,(when message-user-organization 'Organization) ;; ,(when message-user-organization 'Organization)
))) ))
(message-this-is-mail t)) (message-this-is-mail t))
;; we handle it ourselves. ;; we handle it ourselves.
(setq-local gnus-message-replysign nil (setq-local gnus-message-replysign nil
gnus-message-replyencrypt nil gnus-message-replyencrypt nil
gnus-message-replysignencrypted nil) gnus-message-replysignencrypted nil)
(when parent (when parent
(insert (mu4e-view-message-text parent))) (insert (mu4e-view-message-text parent 'all-headers)))
(goto-char (point-min)) (goto-char (point-min))
;; annoyingly, various message- functions call `message-pop-to-buffer` ;; annoyingly, various message- functions call `message-pop-to-buffer`
;; (showing the message. But we're not ready for that yet. So ;; (showing the message. But we're not ready for that yet. So

View File

@ -660,17 +660,17 @@ As a side-effect, a message that is being viewed loses its
(let ((inhibit-read-only t)) (let ((inhibit-read-only t))
(run-hooks 'mu4e-view-rendered-hook)))) (run-hooks 'mu4e-view-rendered-hook))))
(defun mu4e-view-message-text (msg) (defun mu4e-view-message-text (msg &optional all-headers)
"Return the pristine MSG as a string." "Return the pristine MSG as a string.
;; we need this for replying/forwarding, since the mu4e-compose If ALL-HEADERS is non-nil, include all headers."
;; wants it that way.
(with-temp-buffer (with-temp-buffer
(insert-file-contents-literally (insert-file-contents-literally
(mu4e-message-readable-path msg) nil nil nil t) (mu4e-message-readable-path msg) nil nil nil t)
(let ((gnus-inhibit-mime-unbuttonizing nil) (let ((gnus-inhibit-mime-unbuttonizing nil)
(gnus-unbuttonized-mime-types '(".*/.*"))) (gnus-unbuttonized-mime-types '(".*/.*"))
(mu4e--view-render-buffer msg)) (gnus-inhibit-hiding all-headers))
(buffer-substring-no-properties (point-min) (point-max)))) (gnus-article-prepare-display)
(buffer-substring-no-properties (point-min) (point-max)))))
(defun mu4e-action-view-in-browser (msg &optional skip-headers) (defun mu4e-action-view-in-browser (msg &optional skip-headers)
"Show current MSG in browser if it includes an HTML-part. "Show current MSG in browser if it includes an HTML-part.