From 797ca3e37fe74f081c16540b8c25a34a4e4276a4 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Wed, 28 Aug 2024 23:05:33 +0300 Subject: [PATCH] mu4e-draft: move the user-agent setting This updates commit 411407f03e4bf55250d96015f427a86a373bfb12 and moves the check to where we set the special headers. --- mu4e/mu4e-draft.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mu4e/mu4e-draft.el b/mu4e/mu4e-draft.el index b28ad4033..d7053540b 100644 --- a/mu4e/mu4e-draft.el +++ b/mu4e/mu4e-draft.el @@ -565,13 +565,14 @@ PARENT is the parent message, if any." (defun mu4e--prepare-draft-headers (compose-type) "Add extra headers for message based on COMPOSE-TYPE." - (message-generate-headers - (seq-filter #'identity ;; ensure needed headers are generated. - `(From Subject Date Message-ID - ,(when (memq compose-type '(reply forward)) 'References) - ,(when (eq compose-type 'reply) 'In-Reply-To) - ,(when message-newsreader 'User-Agent) - ,(when message-user-organization 'Organization))))) + (let ((message-newsreader mu4e-user-agent-string)) + (message-generate-headers + (seq-filter #'identity ;; ensure needed headers are generated. + `(From Subject Date Message-ID + ,(when (memq compose-type '(reply forward)) 'References) + ,(when (eq compose-type 'reply) 'In-Reply-To) + ,(when message-newsreader 'User-Agent) + ,(when message-user-organization 'Organization)))))) (defun mu4e--prepare-draft-buffer (compose-type parent) "Prepare the current buffer as a draft-buffer. @@ -723,8 +724,7 @@ Returns the new buffer." ;; compose-func (let ((draft-buffer) (oldframe (selected-frame)) - (oldwinconf (current-window-configuration)) - (message-newsreader mu4e-user-agent-string)) + (oldwinconf (current-window-configuration))) (with-temp-buffer ;; provide a temp buffer so the compose-func can do its thing (setq draft-buffer (mu4e--validate-hidden-buffer (funcall compose-func)))