From: morioka Date: Mon, 29 Jun 1998 00:53:00 +0000 (+0000) Subject: (mime-write-entity-content): New function. X-Git-Tag: chao-1_7_0-199811302358~2 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d33799fa941e37ed9e65e30c1f7daa67f58f320;p=elisp%2Fflim.git (mime-write-entity-content): New function. --- diff --git a/mime.el b/mime.el index 37eaf70..681376d 100644 --- a/mime.el +++ b/mime.el @@ -392,6 +392,20 @@ ENTITY is used." (mime-entity-body-end entity)) (mime-entity-encoding entity)))) +(defun mime-write-entity-content (entity filename) + "Write content of ENTITY into FILENAME." + (save-excursion + (set-buffer (mime-entity-buffer entity)) + (let ((encoding (or (mime-entity-encoding entity) "7bit"))) + (if (and (mime-entity-cooked-p entity) + (member encoding '("7bit" "8bit" "binary"))) + (write-region (mime-entity-body-start entity) + (mime-entity-body-end entity) filename) + (mime-write-decoded-region (mime-entity-body-start entity) + (mime-entity-body-end entity) + filename encoding) + )))) + (defun mime-write-entity (entity filename) "Write ENTITY into FILENAME." (save-excursion