(mime-library-product): Update to 1.13.1.
[elisp/flim.git] / mime-def.el
index 331f573..e1b6b0f 100644 (file)
 
 ;;; Code:
 
+(require 'poe)
+(require 'poem)
+(require 'pcustom)
 (require 'mcharset)
+(require 'alist)
+
+(eval-when-compile (require 'cl))      ; list*
 
 (eval-and-compile
-  (defconst mime-library-product ["Chao" (1 13 0) "JR Fujinomori"]
+  (defconst mime-library-product ["FLIM" (1 13 1) "Tawaramoto"]
     "Product name, version number and code name of MIME-library package.")
   )
 
 
 (require 'custom)
 
-(eval-when-compile (require 'cl))
-
-(defgroup mime nil
+(defgroup mime '((default-mime-charset custom-variable))
   "Emacs MIME Interfaces"
   :group 'news
   :group 'mail)
 
-(custom-handle-keyword 'default-mime-charset :group 'mime
-                      'custom-variable)
-
 (defcustom mime-uuencode-encoding-name-list '("x-uue" "x-uuencode")
   "*List of encoding names for uuencode format."
   :group 'mime
 
 (luna-define-internal-accessors 'mime-entity)
 
-
-;;; @ message structure
-;;;
-
-(defvar mime-message-structure nil
-  "Information about structure of message.
-Please use reference function `mime-entity-SLOT' to get value of SLOT.
-
-Following is a list of slots of the structure:
-
-node-id                        node-id (list of integers)
-content-type           content-type (content-type)
-content-disposition    content-disposition (content-disposition)
-encoding               Content-Transfer-Encoding (string or nil)
-children               entities included in this entity (list of entity)
-
-If an entity includes other entities in its body, such as multipart or
-message/rfc822, `mime-entity' structures of them are included in
-`children', so the `mime-entity' structure become a tree.")
-
-(make-variable-buffer-local 'mime-message-structure)
+(luna-define-method mime-entity-fetch-field ((entity mime-entity)
+                                            field-name)
+  (or (symbolp field-name)
+      (setq field-name (intern (capitalize (capitalize field-name)))))
+  (cdr (assq field-name
+            (mime-entity-original-header-internal entity))))
 
 
 ;;; @ for mm-backend
@@ -271,28 +257,40 @@ message/rfc822, `mime-entity' structures of them are included in
                (cdr args)))
     `(luna-define-method ,name ,args ,@body)
     ))
+
 (put 'mm-define-method 'lisp-indent-function 'defun)
 
-(eval-when-compile
-  (defmacro eval-module-depended-macro (module definition)
-    (condition-case nil
-       (progn
-         (require (eval module))
-         definition)
-      (error `(eval-after-load ,(symbol-name (eval module)) ',definition))
-      ))
-  )
+(def-edebug-spec mm-define-method
+  (&define name ((arg symbolp)
+                [&rest arg]
+                [&optional ["&optional" arg &rest arg]]
+                &optional ["&rest" arg]
+                )
+          def-body))
 
-(eval-module-depended-macro
- 'edebug
- (def-edebug-spec mm-define-method
-   (&define name ((arg symbolp)
-                 [&rest arg]
-                 [&optional ["&optional" arg &rest arg]]
-                 &optional ["&rest" arg]
-                 )
-           def-body))
- )
+
+;;; @ message structure
+;;;
+
+(defvar mime-message-structure nil
+  "Information about structure of message.
+Please use reference function `mime-entity-SLOT' to get value of SLOT.
+
+Following is a list of slots of the structure:
+
+node-id                        node-id (list of integers)
+content-type           content-type (content-type)
+content-disposition    content-disposition (content-disposition)
+encoding               Content-Transfer-Encoding (string or nil)
+children               entities included in this entity (list of entity)
+
+If an entity includes other entities in its body, such as multipart or
+message/rfc822, `mime-entity' structures of them are included in
+`children', so the `mime-entity' structure become a tree.")
+
+(make-variable-buffer-local 'mime-message-structure)
+
+(make-obsolete-variable 'mime-message-structure "should not use it.")
 
 
 ;;; @ for mel-backend