mu4e: fix sending emails with no body

This commit is contained in:
John Whitbeck
2017-03-11 22:17:56 -08:00
parent 8f1f88ce0a
commit bbd8f55700

View File

@ -302,10 +302,15 @@ 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)
(replace-match sepa) (progn
(progn ;; no empty line? then prepend one (replace-match sepa)
(goto-char (point-max)) ;; `message-narrow-to-headers` searches for a `mail-header-separator` followed by a new
(insert "\n" sepa)))))) ;; 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
(goto-char (point-max))
(insert "\n" sepa))))))
(defun mu4e~draft-remove-mail-header-separator () (defun mu4e~draft-remove-mail-header-separator ()
"Remove `mail-header-separator; we do this before saving a "Remove `mail-header-separator; we do this before saving a