From 9bfdf208e033a954fd0250789f58f00b8d1b3bd9 Mon Sep 17 00:00:00 2001 From: morioka Date: Tue, 30 Jun 1998 12:17:33 +0000 Subject: [PATCH] (mmbuffer-entity-content): New function. (mmbuffer-write-entity-content): New function. --- mmbuffer.el | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/mmbuffer.el b/mmbuffer.el index fd948b3..483a696 100644 --- a/mmbuffer.el +++ b/mmbuffer.el @@ -24,7 +24,7 @@ ;;; Code: -(require 'mime-parse) +(require 'mime) (defun mmbuffer-open-entity (location) (mime-parse-buffer location) @@ -49,6 +49,23 @@ (defun mmbuffer-cooked-p () nil) +(defun mmbuffer-entity-content (entity) + (save-excursion + (set-buffer (mime-entity-buffer-internal entity)) + (mime-decode-string + (buffer-substring (mime-entity-body-start-internal entity) + (mime-entity-body-end-internal entity)) + (mime-entity-encoding entity)))) + +(defun mmbuffer-write-entity-content (entity filename) + (save-excursion + (set-buffer (mime-entity-buffer-internal entity)) + (mime-write-decoded-region (mime-entity-body-start-internal entity) + (mime-entity-body-end-internal entity) + filename + (or (mime-entity-encoding entity) "7bit")) + )) + ;;; @ end ;;; -- 1.7.10.4