(mime-library-product): Update to 1.14.1.
[elisp/flim.git] / mime-def.el
index 66dfa00..f4ced4d 100644 (file)
@@ -34,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)
   :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 "\\|") "\\)"))
 
-(eval-when-compile (require 'static))
-
-(static-if (and (featurep 'xemacs)
-               (not (featurep 'utf-2000)))
-    (progn
-      (require 'pces)
-      (defalias 'binary-insert-file-contents 'insert-file-contents-as-binary)
-      (defalias 'binary-write-region 'write-region-as-binary))
-  (defalias 'binary-insert-file-contents 'insert-file-contents-literally)
-  (defun binary-write-region (start end filename
-                                   &optional append visit lockname)
-    "Like `write-region', q.v., but don't encode."
-    (let ((coding-system-for-write 'binary)
-         jka-compr-compression-info-list jam-zcat-filename-list)
-      (write-region start end filename append visit lockname)))
-  )
-
 (or (fboundp 'char-int)
     (defalias 'char-int 'identity))
 
   (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)