(mime-library-product): Update to 1.14.1.
[elisp/flim.git] / mime-def.el
index acae86f..f4ced4d 100644 (file)
@@ -24,9 +24,7 @@
 
 ;;; Code:
 
-(require 'poe)
-(require 'poem)
-(require 'pcustom)
+(require 'custom)
 (require 'mcharset)
 (require 'alist)
 
@@ -36,7 +34,7 @@
   )
 
 (eval-and-compile
-  (defconst mime-library-product ["FLIM" (1 14 0) "Ninokuchi"]
+  (defconst mime-library-product ["FLIM" (1 14 1) "Yagi"]
     "Product name, version number and code name of MIME-library package."))
 
 (defmacro mime-product-name (product)
@@ -59,8 +57,6 @@
 ;;; @ variables
 ;;;
 
-(require 'custom)
-
 (defgroup mime '((default-mime-charset custom-variable))
   "Emacs MIME Interfaces"
   :group 'news
   :type '(repeat string))
 
 
+;;; @@ for encoded-word
+;;;
+
+(defgroup mime-header nil
+  "Header representation, specially encoded-word"
+  :group 'mime)
+
+;;; @@@ decoding
+;;;
+
+(defcustom mime-field-decoding-max-size 1000
+  "*Max size to decode header field."
+  :group 'mime-header
+  :type '(choice (integer :tag "Limit (bytes)")
+                (const :tag "Don't limit" nil)))
+
+;;; @@@ encoding
+;;;
+
+(defcustom mime-field-encoding-method-alist
+  '(("X-Nsubject" . iso-2022-jp-2)
+    ("Newsgroups" . nil)
+    ("Message-ID" . nil)
+    (t            . mime)
+    )
+  "*Alist to specify field encoding method.
+Its key is field-name, value is encoding method.
+
+If method is `mime', this field will be encoded into MIME format.
+
+If method is a MIME-charset, this field will be encoded as the charset
+when it must be convert into network-code.
+
+If method is `default-mime-charset', this field will be encoded as
+variable `default-mime-charset' when it must be convert into
+network-code.
+
+If method is nil, this field will not be encoded."
+  :group 'mime-header
+  :type '(repeat (cons (choice :tag "Field"
+                              (string :tag "Name")
+                              (const :tag "Default" t))
+                      (choice :tag "Method"
+                              (const :tag "MIME conversion" mime)
+                              (symbol :tag "non-MIME conversion")
+                              (const :tag "no-conversion" nil)))))
+
+
 ;;; @ required functions
 ;;;
 
 (defsubst regexp-or (&rest args)
   (concat "\\(" (mapconcat (function identity) args "\\|") "\\)"))
 
+(or (fboundp 'char-int)
+    (defalias 'char-int 'identity))
+
 
 ;;; @ about STD 11
 ;;;
   (cdr (car content-type)))
 
 (defsubst mime-content-type-subtype (content-type)
-  "Return primary-type of CONTENT-TYPE."
+  "Return subtype of CONTENT-TYPE."
   (cdr (cadr content-type)))
 
 (defsubst mime-content-type-parameters (content-type)
-  "Return primary-type of CONTENT-TYPE."
+  "Return parameters of CONTENT-TYPE."
   (cddr content-type))
 
 (defsubst mime-content-type-parameter (content-type parameter)