From: morioka Date: Tue, 30 Jun 1998 12:17:33 +0000 (+0000) Subject: (mmbuffer-entity-content): New function. X-Git-Tag: flim-1_8_0~26 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=9bfdf208e033a954fd0250789f58f00b8d1b3bd9;p=elisp%2Fflim.git (mmbuffer-entity-content): New function. (mmbuffer-write-entity-content): New function. --- 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 ;;;