FLIM 1.14 Reference Manual about MIME Features
**********************************************

This file documents MIME features of FLIM, a fundamental library to
process Internet Messages for GNU Emacsen.

1 What is FLIM?
***************

FLIM is a library to provide basic features about message
representation or encoding.

2 How to use MIME features
**************************

Please eval following to use MIME features provided by FLIM:

     (require 'mime)

3 Message and Entity
********************

According to RFC 2045 (see RFC 2045), `The term "entity", refers
specifically to the MIME-defined header fields and contents of either a
message or one of the parts in the body of a multipart entity.'  In this
document, the term *entity* indicates all of header fields and body.

   The definition of RFC 2045 indicates that a MIME message is a tree,
and each node of the tree is an entity.  Namely MIME extends message to
tree structure.

   FLIM uses *mime-entity* structure to represent information of
entity.  In this document, it is called simply `mime-entity'.

3.1 Functions to create mime-entity
===================================

 -- Function: mime-open-entity &optional type location
     Open an entity and return it.

     TYPE is representation-type. (cf. mm-backend)

     LOCATION is location of entity.  Specification of it is depended
     on representation-type.

 -- Function: mime-parse-buffer &optional buffer type
     Parse BUFFER as message, and set the result to buffer local
     variable `mime-message-structure' of BUFFER as mime-entity.

     If BUFFER is omitted, current buffer is used.

     TYPE is representation-type of created mime-entity. (cf.
     mm-backend) Default value is BUFFER.

3.2 Features about message tree
===============================

Structure of a MIME message is tree.

   In the tree, root node is the entity indicates all of the message.
In this document, it is called *root-entity* or *message*.  In FLIM, it
is indicated by buffer local variable `mime-message-structure'.

   Each entity except root-entity has a parent.  An entity may have
children.  We can indicate an entity by relative position from a base
entity, based on the parent-child relationship.

   In addition, we can indicate an entity by absolute position of the
message.

   Each entity, which is a node of the tree, can be numbered by depth
and left-to-right order of the depth.

                                   +-------+
                                   |  nil  |
                                   +---+---+
                   +-------------------+-------------------+
                 +-+-+               +-+-+               +-+-+
                 | 0 |               | 1 |               | 2 |
                 +-+-+               +-+-+               +-+-+
                   |         +---------+---------+         |
                +--+--+   +--+--+   +--+--+   +--+--+   +--+--+
                | 0.0 |   | 1.0 |   | 1.1 |   | 1.2 |   | 2.0 |
                +-----+   +-----+   +-----+   +-----+   +-----+

   Namely, if depth of a node is n, the node has a node-number, which is
consists of n integers.  In this document, it is called
*entity-number*.  An entity-number is represented by list of integer,
like `(1 2 3)'.

   mime-entity has also *node-id*.  A node-id is represented by
reversed list of entity-number.  For example, node-id corresponding with
1.2.3 is `(3 2 1)'.

   Each entity can be indicated by entity-number or node-id in
`mime-message-structure'.

 -- Variable: mime-message-structure
     Buffer local variable to store mime-entity structure of message.

 -- Function: mime-entity-children entity
     Return list of entities included in the ENTITY.

 -- Function: mime-entity-parent entity &optional message
     Return parent entity of the ENTITY.

     If MESSAGE is specified, it is regarded as root instead of
     `mime-message-structure'.

 -- Function: mime-root-entity-p entity
     Return non-`nil' if ENTITY is root entity (message).

 -- Function: mime-entity-node-id entity
     Return node-id of ENTITY.

 -- Function: mime-entity-number entity
     Return entity-number of ENTITY.

3.3 Find Entity
===============

 -- Function: mime-find-entity-from-number entity-number &optional
          message
     Return entity from ENTITY-NUMBER in MESSAGE.

     If MESSAGE is not specified, `mime-message-structure' is used.

 -- Function: mime-find-entity-from-node-id entity-node-id &optional
          message
     Return entity from ENTITY-NODE-ID in MESSAGE.

     If MESSAGE is not specified, `mime-message-structure' is used.

 -- Function: mime-find-entity-from-content-id cid &optional message
     Return entity from CID in MESSAGE.

     If MESSAGE is not specified, `mime-message-structure' is used.

3.4 Functions about attributes of mime-entity
=============================================

 -- Function: mime-entity-content-type entity
     Return content-type of ENTITY.  (cf. mime-content-type)

 -- Function: mime-entity-content-disposition entity
     Return content-disposition of ENTITY. (cf.
     mime-content-disposition)

 -- Function: mime-entity-filename entity
     Return file name of ENTITY.

 -- Function: mime-entity-encoding entity &optional default-encoding
     Return content-transfer-encoding of ENTITY.  (cf.
     Content-Transfer-Encoding)

     If the ENTITY does not have Content-Transfer-Encoding field, this
     function returns DEFAULT-ENCODING.  If it is nil, `"7bit"' is used
     as default value.

 -- Function: mime-entity-cooked-p entity
     Return non-nil if contents of ENTITY has been already
     code-converted.

3.5 Information of entity header
================================

 -- Function: mime-fetch-field field-name &optional entity
     Return field-body of FIELD-NAME field in header of ENTITY.

     The results is network representation.

     If ENTITY is omitted, `mime-message-structure' is used as default
     value.

     If FIELD-NAME field is not found, this function returns `nil'.

 -- Function: mime-read-field field-name &optional entity
     Parse FIELD-NAME field in header of ENTITY, and return the result.

     Format of result is depended on kind of field.  For non-structured
     field, this function returns string.  For structured field, it
     returns list corresponding with structure of the field.

     Strings in the result will be converted to internal representation
     of Emacs.

     If ENTITY is omitted, `mime-message-structure' is used as default
     value.

     If FIELD-NAME field is not found, this function returns `nil'.

3.6 Text presentation of entity
===============================

 -- Function: mime-insert-header entity &optional invisible-fields
          visible-fields
     Insert before point a decoded contents of header of ENTITY.

     INVISIBLE-FIELDS is list of regexps to match field-name to hide.
     VISIBLE-FIELDS is list of regexps to match field-name to hide.

     If a field-name is matched with some elements of INVISIBLE-FIELDS
     and matched with none of VISIBLE-FIELDS, this function don't
     insert the field.

     Each encoded-word (see encoded-word) in the header is decoded.
     "Raw non us-ascii characters" are also decoded as
     `default-mime-charset'.

 -- Function: mime-insert-text-content entity
     Insert before point a contents of ENTITY as text entity.

     Contents of the ENTITY are decoded as MIME charset (see MIME charset).
     If the ENTITY does not have charset parameter of
     Content-Type field, `default-mime-charset' is used as default
     value.

 -- Variable: default-mime-charset
     Symbol to indicate default value of MIME charset (see MIME charset).

     It is used when MIME charset is not specified.

     It is originally variable of APEL.

3.7 Contents of Entity
======================

 -- Function: mime-entity-content entity
     Return content of ENTITY as byte sequence.

 -- Function: mime-insert-entity-content entity
     Insert content of ENTITY at point.

 -- Function: mime-write-entity-content entity filename
     Write content of ENTITY into FILENAME.

3.8 Network representation of Entity
====================================

 -- Function: mime-insert-entity entity
     Insert header and body of ENTITY at point.

 -- Function: mime-write-entity entity filename
     Write representation of ENTITY into FILENAME.

 -- Function: mime-write-entity-body entity filename
     Write body of ENTITY into FILENAME.

3.9 Entity as buffer representation
===================================

 -- Function: mime-entity-buffer entity
     Return buffer, which contains ENTITY.

 -- Function: mime-entity-point-min entity
     Return the start point of ENTITY in the buffer which contains
     ENTITY.

 -- Function: mime-entity-point-max entity
     Return the end point of ENTITY in the buffer which contains ENTITY.

 -- Function: mime-entity-header-start entity
     Return the start point of header of ENTITY in the buffer which
     contains ENTITY.

 -- Function: mime-entity-header-end entity
     Return the end point of header of ENTITY in the buffer which
     contains ENTITY.

 -- Function: mime-entity-body-start entity
     Return the start point of body of ENTITY in the buffer which
     contains ENTITY.

 -- Function: mime-entity-body-end entity
     Return the end point of body of ENTITY in the buffer which
     contains ENTITY.

3.10 Entity representations and implementations
===============================================

Entity is an abstraction.  It is designed to use various data
representations for their purposes.

   Each entity has *representation-type*.  It must be specified when an
entity is created. (cf. Entity Creation)

   Functions about entity are implemented by request processing to the
entity.  Each entity knows its representation-type.  Each entity calls
processing function corresponding with the representation-type.  Such
kind of function is called *entity processing method*.  A module,
consists of them corresponding with a representation-type, is called
*mm-backend*.

   Module name of each mm-backend consists of the prefix `mm' and its
representation-type.  The module is required automatically when its
entity is created at first.

3.10.1 Message-passing for entity
---------------------------------

 -- Function: mime-entity-send entity message &rest args
     Send MESSAGE to ENTITY with ARGS, and return the result.

     ARGS is arguments of the MESSAGE.

3.10.2 Definition of mm-backend
-------------------------------

 -- Macro: mm-define-backend type &optional parents
     Define TYPE as a mm-backend.

     If PARENTS is specified, TYPE inherits parents.  Each parent must
     be representation-type.

     Example:

          (mm-define-backend chao (generic))

 -- Macro: mm-define-method name args &rest body
     Define NAME as a method function of (nth 1 (car ARGS)) backend.

     ARGS is like an argument list of lambda, but (car ARGS) must be
     specialized parameter.  (car (car ARGS)) is name of variable and
     (nth 1 (car ARGS)) is name of backend (representation-type).

     Example:

          (mm-define-method entity-cooked-p ((entity chao)) nil)

4 Information of Content-Type field
***********************************

*Content-Type field* is a field to indicate kind of contents or data
format, such as media-type (see media-type) and MIME charset.  It
is defined in RFC 2045 (see RFC 2045).

*[Memo]*

     Historically, Content-Type field was proposed in RFC 1049.  In it,
     Content-Type did not distinguish type and subtype, and there are no
     mechanism to represent kind of character code like MIME charset.

   FLIM provides parser for Content-Type field and structure
*mime-content-type* to store information of Content-Type field.

4.1 Format of Content-Type field
================================

Format of Content-Type field is defined as follows:

     "Content-Type" ":" *type* "/" *subtype* *( ";" *parameter* )

   For example:

          Content-Type: image/jpeg

          Content-Type: text/plain; charset=iso-2022-jp

   `type' and `subtype' indicate format of an entity.  In this document,
pair of them is called `media-type'.  `image/jpeg' or `text/plain' is a
media-type.

*[Memo]*

     If an entity does not have Content-Type field, it is regarded as
     following:

               Content-Type: text/plain; charset=us-ascii

     (cf. us-ascii)

4.2 mime-content-type structure
===============================

 -- Structure: mime-content-type
     Structure to store information of a Content-Type field.

     Applications should use reference functions
     `mime-content-type-SLOT' to refer information of the structure.

     Slots of the structure are following:

    PRIMARY-TYPE
          primary type of media-type (symbol).

    SUBTYPE
          subtype of media-type (symbol).

    PARAMETERS
          parameters of Content-Type field (association-list).

 -- Function: make-mime-content-type type subtype
     	   &optional  parameters

     Constructor of content-type.

 -- Function: mime-content-type-parameter content-type parameter
     Return value of PARAMETER of CONTENT-TYPE.

4.3 Parser
==========

 -- Function: mime-parse-Content-Type string
     Parse STRING as a field-body of Content-Type field, and return the
     result as mime-content-type (see mime-content-type) structure.

 -- Function: mime-read-Content-Type
     Parse Content-Type field of the current buffer, and return the
     result as mime-content-type (see mime-content-type) structure.

     Return `nil' if Content-Type field is not found.

4.4 Utility functions
=====================

 -- Function: mime-type/subtype-string type &optional subtype
     Return type/subtype string from TYPE and SUBTYPE.

5 Information of Content-Disposition field
******************************************

*Content-Disposition field* is an optional field to specify
presentation of an entity or attributes of an entity, such as file name.

[RFC 2183]

     S. Dorner, K. Moore and R. Troost, "Communicating Presentation
     Information in Internet Messages: The Content-Disposition Header",
     August 1997, Standards Track.

   FLIM provides parser for Content-Disposition field and structure
*mime-content-disposition* to store information of Content-Disposition
field.

5.1 mime-content-disposition structure
======================================

 -- Structure: mime-content-disposition
     Structure to store information of a Content-Disposition field.

     Applications should use reference functions
     `mime-content-disposition-SLOT' to refer information of the
     structure.

     Slots of the structure are following:

    DISPOSITION-TYPE
          disposition-type (symbol).

    PARAMETERS
          parameters of Content-Disposition field (association-list).

 -- Function: mime-content-disposition-parameter content-disposition
          parameter
     Return value of PARAMETER of CONTENT-DISPOSITION.

 -- Function: mime-content-disposition-filename content-disposition
     Return filename of CONTENT-DISPOSITION.

5.2 Parser for Content-Disposition field
========================================

 -- Function: mime-parse-Content-Disposition string
     Parse STRING as field-body of Content-Disposition field, and
     return the result as mime-content-disposition (see
     mime-content-disposition) structure.

 -- Function: mime-read-Content-Disposition
     Parse Content-Disposition field of the current buffer, and return
     the result as mime-content-disposition (see
     mime-content-disposition) structure.

     Return `nil' if Content-Disposition field is not found.

6 Encoding Method
*****************

*Content-Transfer-Encoding field* is a header field to indicate body
encoding of a entity.

   FLIM provides parser functions for Content-Transfer-Encoding field.
They represent information of Content-Transfer-Encoding field as string.

   In addition, FLIM provides encoder/decoder functions by
Content-Transfer-Encoding.

6.1 Parser
==========

 -- Function: mime-parse-Content-Transfer-Encoding string
     Parse STRING as a field-body of Content-Transfer-Encoding field,
     and return the result.

 -- Function: mime-read-Content-Transfer-Encoding &optional
          default-encoding
     Parse Content-Transfer-Encoding field of the current buffer, and
     return the result.

     Return DEFAULT-ENCODING if Content-Transfer-Encoding field is not
     found.  If it is not specified, `nil' is used as the default value.

6.2 Encoder/decoder
===================

 -- Function: mime-encode-region start end encoding
     Encode region START to END of current buffer using ENCODING.

 -- Function: mime-decode-region start end encoding
     Decode region START to END of current buffer using ENCODING.

 -- Function: mime-decode-string string encoding
     Decode STRING which is encoded in ENCODING, and return the result.

 -- Function: mime-insert-encoded-file filename encoding
     Insert file FILENAME encoded by ENCODING format.

 -- Function: mime-write-decoded-region start end filename encoding
     Decode and write current region encoded by ENCODING into FILENAME.

     START and END are buffer positions.

6.3 Other utilities
===================

 -- Function: mime-encoding-list &optional SERVICE
     Return list of Content-Transfer-Encoding.

     If SERVICE is specified, it returns available list of
     Content-Transfer-Encoding for it.

 -- Function: mime-encoding-alist &optional SERVICE
     Return table of Content-Transfer-Encoding for completion.

     If SERVICE is specified, it returns available list of
     Content-Transfer-Encoding for it.

6.4 How to write encoder/decoder module
=======================================

 -- Macro: mel-define-method name args &rest body
     Define NAME as a method function of (nth 1 (car (last ARGS)))
     backend.

     ARGS is like an argument list of lambda, but (car (last ARGS))
     must be specialized parameter.  (car (car (last ARGS))) is name of
     variable and (nth 1 (car (last ARGS))) is name of backend
     (encoding).

     Example:

          (mel-define-method mime-write-decoded-region (start end filename
          						    (nil "base64"))
            "Decode and write current region encoded by base64 into FILENAME.
          START and END are buffer positions."
            (interactive
             (list (region-beginning) (region-end)
          	 (read-file-name "Write decoded region to file: ")))
            (let ((str (buffer-substring start end)))
              (with-temp-buffer
                (insert (decode-base64-string str))
                (write-region-as-binary (point-min) (point-max) filename)
                )))

 -- Macro: mel-define-method-function spec function
     Set SPEC's function definition to FUNCTION.

     First element of SPEC is service.

     Rest of ARGS is like an argument list of lambda, but (car (last
     ARGS)) must be specialized parameter.  (car (car (last ARGS))) is
     name of variable and (nth 1 (car (last ARGS))) is name of backend
     (encoding).

     Example:

          (mel-define-method-function (mime-encode-string string (nil "base64"))
          			    'encode-base64-string)

6.5 How to add encoding/decoding service
========================================

 -- Macro: mel-define-service name &optional args doc-string
     Define NAME as a service for Content-Transfer-Encodings.

     If ARGS is specified, NAME is defined as a generic function for
     the service.

     Example:

          (mel-define-service encoded-text-encode-string (string encoding)
            "Encode STRING as encoded-text using ENCODING.
          ENCODING must be string.")

7 Network representation of header
**********************************

*RFC 2047* defines the *encoded-word* which is a format to represent
non-ASCII (see ASCII) characters in a header.

[RFC 2047]

     K. Moore, "MIME (Multipurpose Internet Mail Extensions) Part Three:
     Message Header Extensions for Non-ASCII Text", November 1996,
     Standards Track (obsolete RFC 1521,1522,1590).

   The encoded-word is the only valid format to represent non-ASCII
(see ASCII) characters in a header, but there are also invalid
styles.  Such kinds of evil messages represent non-ASCII (see
ASCII) characters in headers without encoded-words (it is called
"raw" non-ASCII (see ASCII) characters).

   FLIM provides encoding/decoding features of both encoded-word and
invalid "raw" non-ASCII (see ASCII) characters.

7.1 Header encoding/decoding
============================

 -- Function: eword-decode-header &optional code-conversion separator
     Decode MIME encoded-words in header fields.

     If CODE-CONVERSION is `nil', only encoded-words are decoded.  If
     CODE-CONVERSION is a MIME charset (see MIME charset),
     non-ASCII bit patterns are decoded as the MIME charset.  Otherwise
     non-ASCII bit patterns are decoded as the `default-mime-charset'.
     (cf. entity formatting)

     If SEPARATOR is not `nil', it is used as header separator.

 -- Function: eword-encode-header &optional code-conversion
     Encode header fields to network representation, such as MIME
     encoded-word.

     Each field is encoded as corresponding method specified by variable
     `mime-field-encoding-method-alist'.

 -- Variable: mime-field-encoding-method-alist
     Association list to specify field encoding method.  Each element
     looks like (FIELD . METHOD).

     If METHOD is `mime', the FIELD will be encoded into MIME format
     (encoded-word).

     If METHOD is `nil', the FIELD will not be encoded.

     If METHOD is a MIME charset, the FIELD will be encoded as the
     charset when it must be convert into network-code.

     Otherwise the FIELD will be encoded as variable
     `default-mime-charset' when it must be convert into network-code.

8 Various Customization
***********************

 -- group: mime
     The group associated with functions related to MIME.

     It belongs to `mail' and `news'.

9 Appendix
**********

9.1 Glossary
============

9.1.1 7bit
----------

*7bit* means any integer between 0 .. 127.

   Any data represented by 7bit integers is called *7bit data*.

   Textual string consisted of Control characters between 0 .. 31 and
127, and space represented by 32, and graphic characters between 33 ..
236 are called *7bit (textual) string*.

   Conventional Internet MTA (see MTA) can translate 7bit data, so
it is no need to translate by Quoted-Printable (see
Quoted-Printable) or Base64 (see Base64) for 7bit data.

   However if there are too long lines, it can not translate by 7bit MTA
even if it is 7bit data.  RFC 821 (see RFC 821) and RFC 2045 (see
RFC 2045) require lines in 7bit data must be less than 998 bytes.  So
if a "7bit data" has a line more than 999 bytes, it is regarded as
binary (see binary).  For example, Postscript file should be
encoded by Quoted-Printable.

9.1.2 8bit
----------

*8bit* means any integer between 0 .. 255.

   Any data represented by 8bit integers is called *8bit data*.

   Textual string consisted of Control characters between 0 .. 31, 127,
and 128 .. 159, and space represented by 32, and graphic characters
between 33 .. 236 and 160 .. 255 are called *8bit (textual) string*.

   For example, iso-8859-1 (see iso-8859-1) or euc-kr (see
euc-kr) are coded-character-set represented by 8bit textual string.

   Traditional Internet MTA (see MTA) can translate only 7bit
(see 7bit) data, so if a 8bit data will be translated such MTA, it
must be encoded by Quoted-Printable (see Quoted-Printable) or Base64
(see Base64).

   However 8bit MTA are increasing today.

   However if there are too long lines, it can not translate by 8bit MTA
even if it is 8bit data.  RFC 2045 (see RFC 2045) require lines in
8bit data must be less than 998 bytes.  So if a "8bit data" has a line
more than 999 bytes, it is regarded as binary (see binary), so it
must be encoded by Base64 or Quoted-Printable.

9.1.3 ASCII
-----------

*ASCII* is a 94-character set contains primary latin characters (A-Z,
a-z), numbers and some characters.  It is a standard of the United
States of America.  It is a variant of ISO 646 (see ISO 646).

[ASCII]

     "Coded Character Set - 7-Bit American Standard Code for Information
     Interchange", ANSI X3.4:1986.

9.1.4 Base64
------------

*Base64* is a transfer encoding method of MIME (see MIME) defined
in RFC 2045 (see RFC 2045).

   The encoding process represents 24-bit groups of input bits as output
strings of 4 encoded characters.  Encoded characters represent integer 0
.. 63 or *pad*.  Base64 data must be 4 * n bytes, so pad is used to
adjust size.

   These 65 characters are subset of all versions of ISO 646, including
US-ASCII, and all versions of EBCDIC.  So it is safe even if it is
translated by non-Internet gateways.

9.1.5 binary
------------

Any byte stream is called *binary*.

   It does not require structureof lines.  It differs from from 8bit
(see 8bit).

   In addition, if line structured data contain too long line (more than
998 bytes), it is regarded as binary.

9.1.6 Coded character set, Character code
-----------------------------------------

A set of unambiguous rules that establishes a character set and the
one-to-one relationship between the characters of the set and their bit
combinations.

9.1.7 media-type
----------------

*media-type* specifies the nature of the data in the body of MIME
(see MIME) entity (see entity).  It consists of *type* and
*subtype*.  It is defined in RFC 2046 (see RFC 2046).

   Currently there are following standard primary-types:

   * *text*

   * *image*

   * *audio*

   * *video*

   * *application*

   * *multipart* (see multipart)

   * *message*

   And there are various subtypes, for example,
application/octet-stream, audio/basic, image/jpeg, multipart/mixed
(see multipart/mixed), text/plain (see text/plain),
video/mpeg...

   You can refer registered media types at MEDIA TYPES
(ftp://ftp.isi.edu/in-notes/iana/assignments/media-types).

   In addition, you can use private type or subtype using *x-token*,
which as the prefix `x-'.  However you can not use them in public.

   (cf. Content-Type field)

9.1.8 message
-------------

In this document, it means mail defined in RFC 822 (see RFC 822) and
news message defined in RFC 1036 (see RFC 1036).

9.1.9 MIME
----------

MIME stands for *Multipurpose Internet Mail Extensions*, it is an
extension for RFC 822 (see RFC 822).

   According to RFC 2045:

   STD 11, RFC 822, defines a message representation protocol specifying
considerable detail about US-ASCII message headers, and leaves the
message content, or message body, as flat US-ASCII text.  This set of
documents, collectively called the Multipurpose Internet Mail
Extensions, or MIME, redefines the format of messages to allow for

  1. textual message bodies in character sets other than US-ASCII,

  2. an extensible set of different formats for non-textual message
     bodies,

  3. multi-part message bodies, and

  4. textual header information in character sets other than US-ASCII.

   It is defined in RFC 2045 (see RFC 2045), RFC 2046 (see RFC 2046),
RFC 2047 (see encoded-word), RFC 2048 (see RFC 2048)
and RFC 2049 (see RFC 2049).

9.1.10 MIME charset
-------------------

Coded character set (see coded character set) used in Content-Type
field (see Content-Type field) or charset parameter of encoded-word
(see encoded-word).

   It is defined in RFC 2045 (see RFC 2045).

   iso-2022-jp (see iso-2022-jp) or euc-kr (see euc-kr) are
kinds of it.  (In this document, MIME charsets are written by small
letters to distinguish graphic character set (see graphic character set).
For example, ISO 8859-1 is a graphic character set, and
iso-8859-1 is a MIME charset)

9.1.11 MTA
----------

*Message Transfer Agent*.  It means mail transfer programs (ex.
sendmail) and news servers.

   (cf. MUA)

9.1.12 MUA
----------

*Message User Agent*.  It means mail readers and news readers.

   (cf. MTA)

9.1.13 Quoted-Printable
-----------------------

*Quoted-Printable* is a transfer encoding method of MIME (see MIME)
defined in RFC 2045 (see RFC 2045).

   If the data being encoded are mostly US-ASCII text, the encoded form
of the data remains largely recognizable by humans.

   (cf. Base64)

9.1.14 RFC 822
--------------

A RFC defines format of Internet mail message, mainly *message header*.

*[Memo]*

     news message is based on RFC 822, so *Internet message* may be
     more suitable than *Internet mail* .

[RFC 822]

     D. Crocker, "Standard for the Format of ARPA Internet Text
     Messages", August 1982, STD 11.

9.1.15 RFC 1036
---------------

A RFC defines format of USENET message.  It is a subset of RFC 822
(see RFC 822).  It is not Internet standard, but a lot of netnews
excepting Usenet uses it.

[USENET: RFC 1036]

     M. Horton and R. Adams, "Standard for Interchange of USENET
     Messages", December 1987, (obsolete RFC 850).

9.1.16 RFC 2045
---------------

[RFC 2045]

     N. Freed and N. Borenstein, "Multipurpose Internet Mail Extensions
     (MIME) Part One: Format of Internet Message Bodies", November 1996,
     Standards Track (obsolete RFC 1521, 1522, 1590).

9.1.17 RFC 2046
---------------

[RFC 2046]

     N. Freed and N. Borenstein, "Multipurpose Internet Mail Extensions
     (MIME) Part Two: Media Types", November 1996, Standards Track
     (obsolete RFC 1521, 1522, 1590).

9.1.18 RFC 2048
---------------

[RFC 2048]

     N. Freed, J. Klensin and J. Postel, "Multipurpose Internet Mail
     Extensions (MIME) Part Four: Registration Procedures", November
     1996, Standards Track (obsolete RFC 1521, 1522, 1590).

9.1.19 RFC 2049
---------------

[RFC 2049]

     N. Freed and N. Borenstein, "Multipurpose Internet Mail Extensions
     (MIME) Part Five: Conformance Criteria and Examples", November
     1996, Standards Track (obsolete RFC 1521, 1522, 1590).

9.1.20 plain text
-----------------

A textual data represented by only coded character set (see coded character set).
It does not have information about font or
typesetting.  (cf. text/plain)

9.1.21 us-ascii
---------------

A MIME charset (see MIME charset) for primary Latin script mainly
written by English or other languages.

   It is a 7bit coded character set (see coded character set) based
on ISO 2022 (see ISO 2022), it contains only ASCII (see ASCII)
and code extension (see code extension) is not allowed.

   It is standard coded character set of Internet mail.  If MIME
charset is not specified, *us-ascii* is used as default.

   In addition, *ASCII* of RFC 822 (see RFC 822) should be
interpreted as us-ascii.

9.2 How to report bugs
======================

If you write bug-reports and/or suggestions for improvement, please
send them to the EMACS-MIME Mailing List:

   *  English <emacs-mime-en@m17n.org>

   *  Japanese <emacs-mime-ja@m17n.org>

   Notice that, we do not welcome bug reports about too old version.
Bugs in old version might be fixed.  So please try latest version at
first.

   You should write *good bug report*.  If you write only "FLIM does
not work", we can not find such situations.  At least, you should write
name, type, variants and version of OS, emacs, APEL, FLIM, SEMI and
MUA, and setting.  In addition, if error occurs, to send backtrace is
very important. (cf. Bugs (emacs))

   Bug may not appear only your environment, but also in a lot of
environment (otherwise it might not bug).  Therefor if you send mail to
author directly, we must write a lot of mails.  So please send mail to
address for EMACS-MIME Mailing List instead of author.

   Via the EMACS-MIME ML, you can report FLIM bugs, obtain the latest
release of FLIM, and discuss future enhancements to FLIM.  To join the
EMACS-MIME ML, send an empty e-mail to:

   *  English  <emacs-mime-en-ctl@m17n.org>

   *  Japanese <emacs-mime-ja-ctl@m17n.org>

9.3 CVS based development
=========================

Files in FLIM are managed under CVS. Therefore you can obtain the
newest FLIM by the following method.

     (0) cvs login

         % cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root login

         CVS password: [CR] # NULL string

     (1) checkout

         % cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root checkout
     	checkout [-r TAG] flim

   If you would like to join CVS based development, please send mail to

   *  <cvs@cvs.m17n.org>

with your account name and your public key for ssh.  cvsroot is
:ext:cvs@cvs.m17n.org:/cvs/root.

9.4 History of FLIM
===================

FLIM の code の最古の部分は 榎並 嗣智 氏が書いた `mime.el' に起源し
ます。この小さな program は Nemacs で動作する iso-2022-jp の B-encoding
専用の encoded-word の復号化プログラムでした。

   その後、守岡 知彦 は `mime.el' を元に`tiny-mime.el' というプロ
グラムを書きます。これは、Nemacs と Mule で動作する encoded-word の符号
化・復号化プログラムでした。`tiny-mime.el' は B-encoding だけでなく
Q-encoding もsupport し、また、MULE で扱うことができるさまざまな MIME
charset (see MIME charset) を同時に使うことができました。この時、
Nemacs と Mule の双方を support するために用いられたテクニックは後に emu
package にまとめられます。

   この頃、守岡 知彦 は `tiny-mime.el' をさまざまな MUA で使うための設
定集も配布していましたが、それらは後に`tiny-mime.el' とともに１つの
package にまとめられ、tm という名前で配布されます。

   守岡 知彦 はやがて、MIME message を閲覧するためのプログラムである
`tm-body.el' を書きます。これは、すぐに`tm-view.el' という名前
に変わりましたが、やがて、これが`tiny-mime.el' に代わって、tm の中
核となります。

   `tm-view.el' は当然、Content-Transfer-Encoding を扱う必要があります。
この目的のために、MEL が整備されはじめました。Base64 に関しては
`tiny-mime.el' の code が移され、また、新たにQuoted-Printable の code
が追加されました。これらが`mel-b.el' と `mel-q.el' になり ました。

   また、後に、守岡 知彦 によって uuencode 用の `mel-u.el' が追加され、
その後に、小林 修平 氏によって x-gzip64 用の`mel-g.el' が追加されま
した。

   tm では後に、守岡 知彦 によって `tiny-mime.el' の再実装が行われ、こ
の過程で、STD 11 の parser が書かれました。これは、現在の `std11.el'
に当たります。また、この過程で `tiny-mime.el' は復 号化を行う
`tm-ew-d.el' と符号化を行う `tm-ew-e.el' に分けられ
ました。この両者が現在の `eword-decode.el' と `eword-encode.el'
の先祖に当たります。

   後に、守岡 知彦 らによって tm
の全面書き換え作業が行われ、この過程で、tm は APEL, MEL, SEMI, EMH,
RMAIL-MIME, Gnus-MIME などに分けられました。こ のうちの MEL が FLIM
の直接の先祖に当たります。

   後に、APEL から `std11.el' が移され、また、`mailcap.el',
`eword-decode.el' および `eword-encode.el' が SEMI から移され、 package
の名前が FLIM となります。

   この直前から田中 哲 氏がより RFC
に忠実な実装を書き始め、これは、現在、 FLIM の枝である "FLIM-FLAM"
となっています。