From 6d9cf642869c0d06fc351bf458372194d67f61cc Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Wed, 13 Mar 2024 07:26:43 +0200 Subject: [PATCH] mu4e-compose: copy message-reply-headers to fake buffer We need copy the buffer-local value from _another_ buffer HT: Martin R. Albrecht. --- mu4e/mu4e-compose.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index 8eafb41bd..d887e3a78 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -734,9 +734,13 @@ Based on the value of `mu4e-compose-switch'." This is a little glue to use `message-reply', `message-forward' etc. We cannot use the normal `message-pop-to-buffer' since we're not ready yet to show the buffer in mu4e." - (set-buffer (get-buffer-create name)) - (erase-buffer) - (current-buffer)) + ;; note: we're in a _different_ buffer here, so we need to copy + ;; message-reply-header's buffer-local value. + (let ((reply-headers message-reply-headers)) + (set-buffer (get-buffer-create name)) + (setq-local message-reply-headers reply-headers) + (erase-buffer) + (current-buffer))) (defun mu4e--headers (compose-type) "Determine headers needed for message."