diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index e96bced9..631a6e88 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -666,18 +666,20 @@ PARENT is the \"parent\" message; nil (message-required-mail-headers (seq-filter #'identity ;; ensure needed headers are generated. `(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? ;; ,(when message-newsreader 'User-Agent) ;; ,(when message-user-organization 'Organization) - ))) + )) (message-this-is-mail t)) ;; we handle it ourselves. (setq-local gnus-message-replysign nil gnus-message-replyencrypt nil gnus-message-replysignencrypted nil) (when parent - (insert (mu4e-view-message-text parent))) + (insert (mu4e-view-message-text parent 'all-headers))) (goto-char (point-min)) ;; annoyingly, various message- functions call `message-pop-to-buffer` ;; (showing the message. But we're not ready for that yet. So diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index ab9fd2b4..3b5c6f80 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -660,17 +660,17 @@ As a side-effect, a message that is being viewed loses its (let ((inhibit-read-only t)) (run-hooks 'mu4e-view-rendered-hook)))) -(defun mu4e-view-message-text (msg) - "Return the pristine MSG as a string." - ;; we need this for replying/forwarding, since the mu4e-compose - ;; wants it that way. +(defun mu4e-view-message-text (msg &optional all-headers) + "Return the pristine MSG as a string. +If ALL-HEADERS is non-nil, include all headers." (with-temp-buffer (insert-file-contents-literally (mu4e-message-readable-path msg) nil nil nil t) (let ((gnus-inhibit-mime-unbuttonizing nil) - (gnus-unbuttonized-mime-types '(".*/.*"))) - (mu4e--view-render-buffer msg)) - (buffer-substring-no-properties (point-min) (point-max)))) + (gnus-unbuttonized-mime-types '(".*/.*")) + (gnus-inhibit-hiding all-headers)) + (gnus-article-prepare-display) + (buffer-substring-no-properties (point-min) (point-max))))) (defun mu4e-action-view-in-browser (msg &optional skip-headers) "Show current MSG in browser if it includes an HTML-part.