mu4e-draft: ensure compose-type is available without parent
In non-parent messages, such as completely new message, ensure the mu4e-compose-type is available during the initial composition, i.e., enlarge the let to cover the rest of `mu4e--prepare-draft'.
This commit is contained in:
@ -25,7 +25,6 @@
|
|||||||
;; Implements various helper functions for mu4e-compose. This all
|
;; Implements various helper functions for mu4e-compose. This all
|
||||||
;; look a little convoluted since we need to subvert the gnus/message
|
;; look a little convoluted since we need to subvert the gnus/message
|
||||||
;; functions a bit to work with mu4e.
|
;; functions a bit to work with mu4e.
|
||||||
|
|
||||||
(require 'message)
|
(require 'message)
|
||||||
(require 'mu4e-config)
|
(require 'mu4e-config)
|
||||||
(require 'mu4e-helpers)
|
(require 'mu4e-helpers)
|
||||||
@ -735,7 +734,7 @@ Returns the new buffer."
|
|||||||
;; run pre-hook early, so user can influence later steps.
|
;; run pre-hook early, so user can influence later steps.
|
||||||
(let ((mu4e-compose-parent-message parent)
|
(let ((mu4e-compose-parent-message parent)
|
||||||
(mu4e-compose-type compose-type))
|
(mu4e-compose-type compose-type))
|
||||||
(run-hooks 'mu4e-compose-pre-hook))
|
(run-hooks 'mu4e-compose-pre-hook)
|
||||||
|
|
||||||
(mu4e--prepare-draft parent)
|
(mu4e--prepare-draft parent)
|
||||||
;; evaluate BODY; this must yield a hidden, live buffer. This is evaluated in
|
;; evaluate BODY; this must yield a hidden, live buffer. This is evaluated in
|
||||||
@ -752,15 +751,15 @@ Returns the new buffer."
|
|||||||
;; we have our basic buffer; turn it into a full mu4e composition
|
;; we have our basic buffer; turn it into a full mu4e composition
|
||||||
;; buffer.
|
;; buffer.
|
||||||
(mu4e--prepare-draft-buffer compose-type parent)))
|
(mu4e--prepare-draft-buffer compose-type parent)))
|
||||||
;; we're ready for composition; let's display it in the way user configured
|
;; we're ready for composition; let's display it in the way user
|
||||||
;; things: directly through display buffer (via pop-t or otherwise through
|
;; configured things: directly through display buffer (via pop-t or
|
||||||
;; mu4e-window.
|
;; otherwise through mu4e-window.
|
||||||
(if (eq mu4e-compose-switch 'display-buffer)
|
(if (eq mu4e-compose-switch 'display-buffer)
|
||||||
(pop-to-buffer draft-buffer)
|
(pop-to-buffer draft-buffer)
|
||||||
(mu4e-display-buffer draft-buffer 'do-select))
|
(mu4e-display-buffer draft-buffer 'do-select))
|
||||||
;; prepare possible message actions (such as cleaning-up)
|
;; prepare possible message actions (such as cleaning-up)
|
||||||
(mu4e--prepare-post oldframe oldwinconf)
|
(mu4e--prepare-post oldframe oldwinconf)
|
||||||
draft-buffer))
|
draft-buffer)))
|
||||||
|
|
||||||
(defun mu4e--draft-with-parent (compose-type parent compose-func)
|
(defun mu4e--draft-with-parent (compose-type parent compose-func)
|
||||||
"Draft a message based on some parent message.
|
"Draft a message based on some parent message.
|
||||||
@ -771,10 +770,7 @@ but note the different order."
|
|||||||
(lambda ()
|
(lambda ()
|
||||||
(let ( ;; only needed for Fwd. Gnus has a bad default.
|
(let ( ;; only needed for Fwd. Gnus has a bad default.
|
||||||
(message-make-forward-subject-function
|
(message-make-forward-subject-function
|
||||||
(list #'message-forward-subject-fwd))
|
(list #'message-forward-subject-fwd)))
|
||||||
;; e.g. supersede needs parent for 'message-is-yours-p
|
|
||||||
(mu4e-compose-parent-message parent)
|
|
||||||
(mu4e-compose-type compose-type))
|
|
||||||
(insert (mu4e--decoded-message parent))
|
(insert (mu4e--decoded-message parent))
|
||||||
;; let's make sure we don't use message-reply-headers from
|
;; let's make sure we don't use message-reply-headers from
|
||||||
;; some unrelated message.
|
;; some unrelated message.
|
||||||
|
|||||||
Reference in New Issue
Block a user