This commit was manufactured by cvs2svn to create branch 'slim-1_14'.
[elisp/flim.git] / mime.el
diff --git a/mime.el b/mime.el
index 2837d0a..63af880 100644 (file)
--- a/mime.el
+++ b/mime.el
@@ -1,8 +1,10 @@
 ;;; mime.el --- MIME library module
 
 ;; Copyright (C) 1998,1999 Free Software Foundation, Inc.
+;; Copyright (C) 1999 Electrotechnical Laboratory, JAPAN.
+;; Licensed to the Free Software Foundation.
 
-;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Author: MORIOKA Tomohiko <tomo@m17n.org>
 ;; Keywords: MIME, multimedia, mail, news
 
 ;; This file is part of FLIM (Faithful Library about Internet Message).
@@ -58,7 +60,7 @@ current-buffer, and return it.")
 (autoload 'mime-uri-parse-cid "mime-parse"
   "Parse STRING as cid URI.")
 
-(autoload 'mime-parse-buffer "mmbuffer"
+(autoload 'mime-parse-buffer "mime-parse"
   "Parse BUFFER as a MIME message.")
 
 )
@@ -141,26 +143,62 @@ If MESSAGE is specified, it is regarded as root entity."
   (null (mime-entity-parent entity message)))
 
 
-;;; @ Entity Buffer
+;;; @ Header buffer
 ;;;
 
-(luna-define-generic mime-entity-buffer (entity))
-
 (luna-define-generic mime-entity-header-buffer (entity))
 
+(luna-define-generic mime-goto-header-start-point (entity)
+  "Set buffer and point to header-start-position of ENTITY.")
+
+(luna-define-generic mime-entity-header-start-point (entity)
+  "Return header-start-position of ENTITY.")
+
+(luna-define-generic mime-entity-header-end-point (entity)
+  "Return header-end-position of ENTITY.")
+
+
+;;; @ Body buffer
+;;;
+
 (luna-define-generic mime-entity-body-buffer (entity))
 
+(luna-define-generic mime-goto-body-start-point (entity)
+  "Set buffer and point to body-start-position of ENTITY.")
+
+(luna-define-generic mime-goto-body-end-point (entity)
+  "Set buffer and point to body-end-position of ENTITY.")
+
+(luna-define-generic mime-entity-body-start-point (entity)
+  "Return body-start-position of ENTITY.")
+
+(define-obsolete-function-alias
+  'mime-entity-body-start 'mime-entity-body-start-point)
+
+(luna-define-generic mime-entity-body-end-point (entity)
+  "Return body-end-position of ENTITY.")
+
+(define-obsolete-function-alias
+  'mime-entity-body-end 'mime-entity-body-end-point)
+
+
+;;; @ Entity buffer (obsolete)
+;;;
+
+(luna-define-generic mime-entity-buffer (entity))
+(make-obsolete 'mime-entity-buffer
+ "use mime-entity-header-buffer or mime-entity-body-buffer instead.")
+
 (luna-define-generic mime-entity-point-min (entity))
+(make-obsolete 'mime-entity-point-min 'mime-entity-header-start-point)
 
 (luna-define-generic mime-entity-point-max (entity))
+(make-obsolete 'mime-entity-point-max 'mime-entity-body-end-point)
 
 
 ;;; @ Entity Header
 ;;;
 
-(luna-define-generic mime-goto-header-start-point (entity)
-  "Set buffer and point to header-start-position of ENTITY.")
-
 (luna-define-generic mime-entity-fetch-field (entity field-name)
   "Return the value of the ENTITY's header field whose type is FIELD-NAME.")
 
@@ -284,10 +322,9 @@ If MESSAGE is specified, it is regarded as root entity."
 (defun mime-entity-uu-filename (entity)
   (if (member (mime-entity-encoding entity) mime-uuencode-encoding-name-list)
       (save-excursion
-       (set-buffer (mime-entity-buffer entity))
-       (goto-char (mime-entity-body-start entity))
+       (mime-goto-body-start-point entity)
        (if (re-search-forward "^begin [0-9]+ "
-                              (mime-entity-body-end entity) t)
+                              (mime-entity-body-end-point entity) t)
            (if (looking-at ".+$")
                (buffer-substring (match-beginning 0)(match-end 0))
              )))))