Merge pull request #1046 from jwhitbeck/master

mu4e: fix sending emails with no body
This commit is contained in:
Dirk-Jan C. Binnema
2017-06-17 12:10:24 +03:00
committed by GitHub

View File

@ -302,7 +302,12 @@ separator is never written to the message file. Also see
;; search for the first empty line ;; search for the first empty line
(goto-char (point-min)) (goto-char (point-min))
(if (search-forward-regexp "^$" nil t) (if (search-forward-regexp "^$" nil t)
(progn
(replace-match sepa) (replace-match sepa)
;; `message-narrow-to-headers` searches for a `mail-header-separator` followed by a new
;; line. Therefore, we must insert a newline if on the last line of the buffer.
(when (= (point) (point-max))
(insert "\n")))
(progn ;; no empty line? then prepend one (progn ;; no empty line? then prepend one
(goto-char (point-max)) (goto-char (point-max))
(insert "\n" sepa)))))) (insert "\n" sepa))))))