From 3d33799fa941e37ed9e65e30c1f7daa67f58f320 Mon Sep 17 00:00:00 2001 From: morioka Date: Mon, 29 Jun 1998 00:53:00 +0000 Subject: [PATCH] (mime-write-entity-content): New function. --- mime.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 -- 1.7.10.4