- (notmuch-mua-mail (mail-header 'to headers)
- (mail-header 'subject headers)
- (loop for header in headers
- if (not (or (eq 'to (car header))
- (eq 'subject (car header))))
- collect header))
- (message-sort-headers)
- (message-hide-headers)
- (save-excursion
- (goto-char (point-max))
- (insert body))
- (set-buffer-modified-p nil)))
+ (let
+ ;; Overlay the composition window on that being used to read
+ ;; the original message.
+ ((same-window-regexps '("\\*mail .*")))
+ (notmuch-mua-mail (mail-header 'to headers)
+ (mail-header 'subject headers)
+ (message-headers-to-generate headers t '(to subject))))
+ ;; insert the message body - but put it in front of the signature
+ ;; if one is present
+ (goto-char (point-max))
+ (if (re-search-backward message-signature-separator nil t)
+ (forward-line -1)
+ (goto-char (point-max)))
+ (insert body))
+ (set-buffer-modified-p nil)
+
+ (message-goto-body))