1 ;;; mmcooked.el --- MIME entity implementation for binary buffer
3 ;; Copyright (C) 1998 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Keywords: MIME, multimedia, mail, news
8 ;; This file is part of FLIM (Faithful Library about Internet Message).
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or (at
13 ;; your option) any later version.
15 ;; This program is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
29 (mm-define-backend cooked (buffer))
31 (mm-define-method entity-cooked-p ((entity cooked)) t)
33 (mm-define-method write-entity-content ((entity cooked) filename)
35 (set-buffer (mime-entity-buffer-internal entity))
36 (let ((encoding (or (mime-entity-encoding entity) "7bit")))
37 (if (member encoding '("7bit" "8bit" "binary"))
38 (write-region (mime-entity-body-start-internal entity)
39 (mime-entity-body-end-internal entity) filename)
40 (mime-write-decoded-region (mime-entity-body-start-internal entity)
41 (mime-entity-body-end-internal entity)
45 (mm-define-method write-entity ((entity cooked) filename)
47 (set-buffer (mime-entity-buffer-internal entity))
48 (write-region (mime-entity-header-start-internal entity)
49 (mime-entity-body-end-internal entity)
53 (mm-define-method write-entity-body ((entity cooked) filename)
55 (set-buffer (mime-entity-buffer-internal entity))
56 (write-region (mime-entity-body-start-internal entity)
57 (mime-entity-body-end-internal entity)
61 (mm-define-method insert-decoded-header ((entity cooked)
62 &optional invisible-fields
64 (let (default-mime-charset)
65 (funcall (mime-find-function 'insert-decoded-header 'buffer)
66 entity invisible-fields visible-fields)
75 ;;; mmcooked.el ends here