(mmbuffer-entity-content): New function.
authormorioka <morioka>
Tue, 30 Jun 1998 12:17:33 +0000 (12:17 +0000)
committermorioka <morioka>
Tue, 30 Jun 1998 12:17:33 +0000 (12:17 +0000)
(mmbuffer-write-entity-content): New function.

mmbuffer.el

index fd948b3..483a696 100644 (file)
@@ -24,7 +24,7 @@
 
 ;;; Code:
 
-(require 'mime-parse)
+(require 'mime)
 
 (defun mmbuffer-open-entity (location)
   (mime-parse-buffer location)
 
 (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
 ;;;