X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fmm-extern.el;h=f2b20f92d90da2f2734869eb240ef6918387112b;hb=bd5c2da9b674dbe4d52c456ce996481be2e8e687;hp=dfd3ca68ac90b3a3268732506d1bcef17ec75c26;hpb=081a5a558e0aeb4feb057f4d370e31ab5a62f12c;p=gnus diff --git a/lisp/mm-extern.el b/lisp/mm-extern.el index dfd3ca68a..f2b20f92d 100644 --- a/lisp/mm-extern.el +++ b/lisp/mm-extern.el @@ -50,7 +50,9 @@ (unless name (error "The filename is not specified.")) (mm-disable-multibyte-mule4) - (mm-insert-file-contents name nil nil nil nil t))) + (if (file-exists-p name) + (mm-insert-file-contents name nil nil nil nil t) + (error (format "File %s is gone." name))))) (defun mm-extern-url (handle) (erase-buffer) @@ -131,11 +133,13 @@ If NO-DISPLAY is nil, display it. Otherwise, do nothing after replacing." (error "Multipart external body is not supported.")) (save-excursion ;; single part (set-buffer (setq buf (mm-handle-buffer handles))) - (condition-case err - (funcall func handle) - (error - (mm-destroy-parts handles) - (error err))) + (let (good) + (unwind-protect + (progn + (funcall func handle) + (setq good t)) + (unless good + (mm-destroy-parts handles)))) (mm-handle-set-cache handle handles)) (push handles gnus-article-mime-handles)) (unless no-display