Commit 92a2c737 authored by Glenn Morris's avatar Glenn Morris

Merge from origin/emacs-26

25d9fe24 Work for empty MIME attachments (related to bug#34387)
parents 38b44242 25d9fe24
......@@ -763,7 +763,7 @@ MIME-Version header before proceeding."
(mb enable-multibyte-characters)
beg)
(goto-char (point-min))
(search-forward-regexp "^\n" nil t)
(search-forward-regexp "^\n" nil 'move) ;; There might be no body.
(setq beg (point))
(with-current-buffer
(generate-new-buffer " *mm*")
......
......@@ -370,10 +370,12 @@
(enriched-decode (point-min) (point-max))))
(mm-handle-set-undisplayer
handle
`(lambda ()
(let ((inhibit-read-only t))
(delete-region ,(copy-marker (point-min) t)
,(point-max-marker))))))))
(if (= (point-min) (point-max))
#'ignore
`(lambda ()
(let ((inhibit-read-only t))
(delete-region ,(copy-marker (point-min) t)
,(point-max-marker)))))))))
(defun mm-insert-inline (handle text)
"Insert TEXT inline from HANDLE."
......
......@@ -982,8 +982,10 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
(unless handles
(setq handles (mm-dissect-buffer t)))
(goto-char (point-min))
(search-forward "\n\n" nil t)
(delete-region (point) (point-max))
(if (search-forward "\n\n" nil 'move)
(delete-region (point) (point-max))
;; No content in the part that is the sole part of this message.
(insert (if (bolp) "\n" "\n\n")))
(if (stringp (car handles))
(mml-insert-mime handles)
(mml-insert-mime handles t))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment