\input texinfo.tex
+@c Generated automatically from mime-ja.sgml by sinfo 3.7.
@setfilename mime-ja.info
-@settitle{FLIM 1.9 MIME \e$B5!G=@bL@=q\e(B}
+@settitle{FLIM 1.12 MIME \e$B5!G=@bL@=q\e(B}
@titlepage
-@title FLIM 1.9 MIME \e$B5!G=@bL@=q\e(B
+@title FLIM 1.12 MIME \e$B5!G=@bL@=q\e(B
@author \e$B<i2,\e(B \e$BCNI'\e(B <morioka@@jaist.ac.jp>
-@subtitle 1998/07/01
+@subtitle 1999-01-27
@end titlepage
@node Top, Introduction, (dir), (dir)
-@top FLIM 1.9 MIME \e$B5!G=@bL@=q\e(B
+@top FLIM 1.12 MIME \e$B5!G=@bL@=q\e(B
@ifinfo
-This file documents MIME features of FLIM, a Internet message
-parsing/encoding library for GNU Emacs.@refill
+This file documents MIME features of FLIM, a fundamental library to
+process Internet Messages for GNU Emacsen.@refill
-GNU Emacs \e$BMQ$N\e(B Internet Message \e$B$N2r@O$dId9f2=$K4X$9$k\e(B library \e$B$G$"$k\e(B
-FLIM \e$B$N\e(B MIME \e$B5!G=$K4X$7$F@bL@$7$^$9!#\e(B
+GNU Emacsen \e$BMQ$N\e(B Internet Message \e$B=hM}$N$?$a$N4pAC\e(B library \e$B$G$"$k\e(B FLIM
+\e$B$N\e(B MIME \e$B5!G=$K4X$7$F@bL@$7$^$9!#\e(B
@end ifinfo
@menu
@node Entity, Content-Type, How to use, Top
@chapter Message \e$B$H\e(B Entity
-@cindex node-id
-@cindex entity-number
@cindex mime-entity
@cindex entity
field \e$B0J30$NA4$F$N\e(B header \e$B$H\e(B body \e$B$r;X$98l$H$7$F\e(B @strong{entity}\e$B$rMQ$$$k\e(B
\e$B$3$H$K$7$^$9!#\e(B@refill
-RFC 2045 \e$B$NDj5A$O!"\e(BMIME message \e$B$,\e(B entity \e$B$rC10L$H$9$kLZ9=B$$G$"$k$3$H$r\e(B
-\e$B<($7$F$$$^$9!#\e(Bmessage \e$B$O2<?^$G<($9$h$&$JLZ$H$J$j!"\e(Bentity \e$B$O$3$NLZ$K$*$1\e(B
-\e$B$k@a$H$J$j$^$9!#$D$^$j!"\e(BMIME \e$B$O\e(B message \e$B$rLZ9=B$$K3HD%$7$?Lu$G$9!#\e(B
-@refill
-
-FLIM \e$B$O\e(B entity \e$B$N>pJs$rI=8=$9$k$?$a$K\e(B@strong{mime-entity} \e$B9=B$BN$rMQ$$$^\e(B
-\e$B$9!#0J2<$G$OC1$K\e(B mime-entity \e$B$H8F$V$3$H$K$7$^$9!#\e(B@refill
-
-\e$BA0=R$N$h$&$K!"\e(Bmessage \e$BCf$N3F\e(B entity \e$B$OLZ$N@a$KEv$?$j$^$9$,!"$3$NLZ$K$O\e(B
-\e$B?<$5$HF1$8?<$5$NCf$N=gHV$K=>$C$FHV9f$,IU$1$k$3$H$,$G$-$^$9!#B($A!"\e(B
-@example
-
- \e$B(#(!(!(!($\e(B
- \e$B("\e(B nil \e$B("\e(B
- \e$B(&(!(((!(%\e(B
- \e$B(#(!(!(!(!(!(!(!(!(!(+(!(!(!(!(!(!(!(!(!($\e(B
- \e$B(#(*($\e(B \e$B(#(*($\e(B \e$B(#(*($\e(B
- \e$B("#0("\e(B \e$B("#1("\e(B \e$B("#2("\e(B
- \e$B(&(((%\e(B \e$B(&(((%\e(B \e$B(&(((%\e(B
- \e$B("\e(B \e$B(#(!(!(!(!(+(!(!(!(!($\e(B \e$B("\e(B
- \e$B(#(!(*(!($(#(!(*(!($(#(!(*(!($(#(!(*(!($(#(!(*(!($\e(B
- \e$B("\e(B \e$B#0\e(B.\e$B#0("("\e(B \e$B#1\e(B.\e$B#0("("\e(B \e$B#1\e(B.\e$B#1("("\e(B \e$B#1\e(B.\e$B#2("("\e(B \e$B#2\e(B.\e$B#0("\e(B
- \e$B(&(!(!(!(%(&(!(!(!(%(&(!(!(!(%(&(!(!(!(%(&(!(!(!(%\e(B
-@end example
-
-@noindent
-\e$B$N$h$&$K?<$5\e(B n \e$B$N@a$K$OD9$5\e(B n \e$B$N@0?tNs$N@aHV9f$,?6$l$^$9!#$3$l\e(B
-\e$B$r\e(B @strong{entity-number} \e$B$H8F$S$^$9!#\e(Bentity-number \e$B$O\e(B S \e$B<0$H\e(B
-\e$B$7$F$O\e(B @code{(1 2 3)} \e$B$N$h$&$J@0?t$N%j%9%H$H$7$FI=8=$5$l$^$9!#\e(B
-
-mime-entity \e$B$G$O!"$3$l$HF1MM$N\e(B @strong{node-id} \e$B$rMQ$$$^$9!#\e(Bnode-id \e$B$O$A$g\e(B
-\e$B$&$I\e(B entity-number \e$B$r5U$K$7$?%j%9%H$G!"\e(Bentity-number 1.2.3 \e$B$KBP1~$9$k\e(B
-node-id \e$B$O\e(B @code{(3 2 1)} \e$B$G$9!#\e(B@refill
+RFC 2045 \e$B$NDj5A$O!"\e(BMIME message \e$B$,\e(B entity \e$B$r@a$H$9$kLZ9=B$$G$"$k$3$H$r<(\e(B
+\e$B$7$F$$$^$9!#$D$^$j!"\e(BMIME \e$B$O\e(B message \e$B$rLZ9=B$$K3HD%$7$?Lu$G$9!#\e(B@refill
-\e$BA0=R$N$h$&$K!"\e(BMIME message \e$B$O\e(B entity \e$B$rC10L$H$7$?LZ9=B$$K$J$C$F$$$k$N$G!"\e(B
-\e$B$3$N:,$G$"$k\e(B message \e$BA4BN$b\e(B mime-entity \e$B$GI=8=$9$k$3$H$,$G$-!"\e(Bbuffer
-local \e$BJQ?t\e(B @code{mime-message-structure} \e$B$K3JG<$9$k$3$H$K$7$^$9!#\e(B
-\e$B$=$7$F!"\e(Bentity-number \e$B$d\e(B node-id \e$B$rMQ$$$k$3$H$G\e(B
-@code{mime-message-structure} \e$B$K$*$1$k\e(B entity \e$B$NAjBPE*$J0LCV4X78$r\e(B
-\e$B07$&$3$H$,$G$-$^$9!#\e(B
+FLIM \e$B$O\e(B entity \e$B$N>pJs$rI=8=$9$k$?$a$K\e(B@strong{mime-entity} \e$B9=\e(B
+\e$BB$BN$rMQ$$$^$9!#0J2<$G$OC1$K\e(B mime-entity \e$B$H8F$V$3$H$K$7$^$9!#\e(B
@menu
* Entity creation:: Entity \e$B$N@8@.\e(B
* Entity hierarchy:: Entity \e$B3,AX\e(B
+* Entity Search:: Entity \e$B$N8!:w\e(B
* Entity Attributes:: Entity \e$B$NB0@-\e(B
* Entity-header:: Entity header \e$B$N>pJs\e(B
+* entity formatting:: Entity \e$B$NJ8;zI=8=\e(B
* Entity-content:: Entity \e$B$NFbMF\e(B
+* Entity-network-representation:: Entity \e$B$N%M%C%H%o!<%/I=8=\e(B
* Entity buffer:: Entity \e$B$N\e(B buffer \e$B$K$h$kI=8=\e(B
* mm-backend:: Entity \e$B$NI=8=$H<B8=\e(B
@end menu
-@node Entity hierarchy, Entity Attributes, Entity creation, Entity
+@node Entity hierarchy, Entity Search, Entity creation, Entity
@section Entity \e$B3,AX\e(B
+@cindex node-id
+@cindex entity-number
+@cindex message
+@cindex root-entity
+
+MIME message \e$B$O\e(B entity \e$B$rC10L$H$9$kLZ9=B$$K$J$C$F$$$^$9!#\e(B@refill
+
+\e$B$3$NLZ$K$*$$$F:,$H$J$k@a$O\e(B message \e$BA4BN$rI=$9\e(B entity \e$B$G$9!#$3$3$G$O!"$3\e(B
+\e$B$l$r\e(B @strong{root-entity} \e$B$b$7$/$O\e(B@strong{message} \e$B$H8F$S$^$9!#\e(B@refill
+
+root-entity \e$B0J30$N\e(B entity \e$B$O?F$r;}$A$^$9!#$^$?!"\e(Bentity \e$B$O;R6!$r;}$D$+$b\e(B
+\e$BCN$l$^$;$s!#$3$N?F;R4X78$r9M$($k$3$H$G\e(B entity \e$B$NAjBP4X78$r07$&$3$H$,$G$-\e(B
+\e$B$^$9!#\e(B@refill
+
+\e$B0lJ}!"\e(Bentity \e$B$N\e(B message \e$B$K$*$1$k0LCV$r9M$($k$3$H$b$G$-$^$9!#\e(B@refill
+
+entity \e$B$O$3$NLZ$K$*$1$k@a$H$J$j$^$9$,!"$3$NLZ$K$O?<$5$HF1$8?<$5$NCf$N\e(B
+\e$B=gHV$K=>$C$FHV9f$,IU$1$k$3$H$,$G$-$^$9!#B($A!"\e(B
+@example
+
+ \e$B(#(!(!(!($\e(B
+ \e$B("\e(B nil \e$B("\e(B
+ \e$B(&(!(((!(%\e(B
+ \e$B(#(!(!(!(!(!(!(!(!(!(+(!(!(!(!(!(!(!(!(!($\e(B
+ \e$B(#(*($\e(B \e$B(#(*($\e(B \e$B(#(*($\e(B
+ \e$B("#0("\e(B \e$B("#1("\e(B \e$B("#2("\e(B
+ \e$B(&(((%\e(B \e$B(&(((%\e(B \e$B(&(((%\e(B
+ \e$B("\e(B \e$B(#(!(!(!(!(+(!(!(!(!($\e(B \e$B("\e(B
+ \e$B(#(!(*(!($(#(!(*(!($(#(!(*(!($(#(!(*(!($(#(!(*(!($\e(B
+ \e$B("\e(B \e$B#0\e(B.\e$B#0("("\e(B \e$B#1\e(B.\e$B#0("("\e(B \e$B#1\e(B.\e$B#1("("\e(B \e$B#1\e(B.\e$B#2("("\e(B \e$B#2\e(B.\e$B#0("\e(B
+ \e$B(&(!(!(!(%(&(!(!(!(%(&(!(!(!(%(&(!(!(!(%(&(!(!(!(%\e(B
+@end example
+
+@noindent
+\e$B$N$h$&$K?<$5\e(B n \e$B$N@a$K$OD9$5\e(B n \e$B$N@0?tNs$N@aHV9f$,?6$l$^$9!#$3$l\e(B
+\e$B$r\e(B @strong{entity-number} \e$B$H8F$S$^$9!#\e(Bentity-number \e$B$O\e(B S \e$B<0$H\e(B
+\e$B$7$F$O\e(B @code{(1 2 3)} \e$B$N$h$&$J@0?t$N%j%9%H$H$7$FI=8=$5$l$^$9!#\e(B
+
+mime-entity \e$B$G$O!"$3$l$HF1MM$N\e(B @strong{node-id} \e$B$rMQ$$$^$9!#\e(Bnode-id \e$B$O$A$g\e(B
+\e$B$&$I\e(B entity-number \e$B$r5U$K$7$?%j%9%H$G!"\e(Bentity-number 1.2.3 \e$B$KBP1~$9$k\e(B
+node-id \e$B$O\e(B @code{(3 2 1)} \e$B$G$9!#\e(B@refill
+
+\e$BA0=R$N$h$&$K!"\e(BMIME message \e$B$O\e(B entity \e$B$rC10L$H$7$?LZ9=B$$K$J$C$F$$$k$N$G!"\e(B
+\e$B$3$N:,$G$"$k\e(B message \e$BA4BN$b\e(B mime-entity \e$B$GI=8=$9$k$3$H$,$G$-!"\e(Bbuffer
+local \e$BJQ?t\e(B @code{mime-message-structure} \e$B$K3JG<$9$k$3$H$K$7$^$9!#\e(B@refill
+
+@code{mime-message-structure} \e$B$r5/E@$K\e(B entity-number \e$B$d\e(B node-id
+\e$B$G<($5$l$k\e(B entity \e$B$r<h$j=P$9$3$H$,$G$-$^$9!#\e(B
@defvar mime-message-structure
@end defun
+
+@node Entity Search, Entity Attributes, Entity hierarchy, Entity
+@section Entity \e$B$N8!:w\e(B
+
@defun mime-find-entity-from-number entity-number &optional message
Return entity from @var{entity-number} in @var{message}.@refill
@end defun
+@defun mime-find-entity-from-content-id cid &optional message
+
+Return entity from @var{cid} in @var{message}.@refill
+
+If @var{message} is not specified, @code{mime-message-structure} is
+used.
+@end defun
-@node Entity Attributes, Entity-header, Entity hierarchy, Entity
+
+
+@node Entity Attributes, Entity-header, Entity Search, Entity
@section Entity \e$B$NB0@-\e(B
@defun mime-entity-content-type entity
-@node Entity-header, Entity-content, Entity Attributes, Entity
+@node Entity-header, entity formatting, Entity Attributes, Entity
@section Entity header \e$B$N>pJs\e(B
@defun mime-fetch-field field-name &optional entity
@end defun
-@defun mime-insert-decoded-header entity &optional invisible-fields visible-fields
+
+@node entity formatting, Entity-content, Entity-header, Entity
+@section Entity \e$B$NJ8;zI=8=\e(B
+
+@defun mime-insert-header entity &optional invisible-fields visible-fields
\e$B8=:_0LCV$K\e(B @var{entity} \e$B$NI|9f$7$?\e(B header \e$B$rA^F~$9$k!#\e(B@refill
@var{invisible-fields} \e$B$NMWAG$N$I$l$+$K\e(B match \e$B$7!"$+$D!"\e(B
@var{visible-fields} \e$B$NMWAG$N$I$l$K$b\e(B match \e$B$7$J$$Ms$OI=<($5$l$J$$!#\e(B
+@refill
+
+encoded-word (@ref{encoded-word}) \e$B$OI|9f$5$l$k!#!X@8$NHs\e(B us-ascii \e$BJ8;z!Y\e(B
+\e$B$O\e(B @code{default-mime-charset} \e$B$H$7$F2r<a$5$l$k!#\e(B
@end defun
+@defun mime-insert-text-content entity
+
+Insert before point a contents of @var{entity} as text entity.@refill
+
+Contents of the @var{entity} are decoded as MIME charset (@ref{MIME charset}). If the @var{entity} does not have charset parameter of
+Content-Type field, @code{default-mime-charset} is used as default
+value.
+@end defun
+
-@node Entity-content, Entity buffer, Entity-header, Entity
+@defvar default-mime-charset
+
+\e$BE,@Z$J\e(B MIME charset (@ref{MIME charset}) \e$B$,8+$D$+$i$J$+$C$?>l9g$KMQ$$$i\e(B
+\e$B$l$k\e(BMIME charset.@refill
+
+\e$BK\Mh$O\e(B APEL \e$B$NJQ?t$G$"$k!#\e(B
+@end defvar
+
+
+
+@node Entity-content, Entity-network-representation, entity formatting, Entity
@section Entity \e$B$NFbMF\e(B
@defun mime-entity-content entity
@end defun
+@defun mime-insert-entity-content entity
+
+Insert content of @var{entity} at point.
+@end defun
+
+
@defun mime-write-entity-content entity filename
Write content of @var{entity} into @var{filename}.
@end defun
+
+@node Entity-network-representation, Entity buffer, Entity-content, Entity
+@section Entity \e$B$N%M%C%H%o!<%/I=8=\e(B
+
+@defun mime-insert-entity entity
+
+Insert header and body of @var{entity} at point.
+@end defun
+
+
@defun mime-write-entity entity filename
Write representation of @var{entity} into @var{filename}.
-@node Entity buffer, mm-backend, Entity-content, Entity
+@node Entity buffer, mm-backend, Entity-network-representation, Entity
@section Entity \e$B$N\e(B buffer \e$B$K$h$kI=8=\e(B
@defun mime-entity-buffer entity
@node mm-backend module, , Request for entity, mm-backend
@subsection mm-backend \e$B$N:n$jJ}\e(B
-\e$B!J$9$_$^$;$s!#$=$N$&$A=q$-$^$9\e(B (^_^;\e$B!K\e(B@refill
+@defmac mm-define-backend type &optional parents
+
+Define @var{type} as a mm-backend.@refill
+
+If @var{PARENTS} is specified, @var{type} inherits parents. Each parent
+must be representation-type.@refill
+
+Example:@refill
+
+@lisp
+(mm-define-backend chao (generic))
+@end lisp
+@end defmac
+
+
+@defmac mm-define-method name args &rest body
+
+Define @var{name} as a method function of (nth 1 (car @var{args}))
+backend.@refill
+
+@var{args} is like an argument list of lambda, but (car @var{args}) must
+be specialized parameter. (car (car @var{args})) is name of variable
+and (nth 1 (car @var{args})) is name of backend
+(representation-type).@refill
+
+Example:@refill
+
+@lisp
+(mm-define-method entity-cooked-p ((entity chao)) nil)
+@end lisp
+@end defmac
-\e$B!J$H$j$"$($:!"\e(Bmm*.el \e$B$r;29M$K$7$F$/$@$5$$!K\e(B
@node Content-Type, Content-Disposition, Entity, Top
@menu
* Content-Transfer-Encoding parser:: Content-Transfer-Encoding \e$BMs$N2r@O4o\e(B
-* Region encoder/decoder:: \e$BNN0h$NId9f2=!&I|9f2=\e(B
-* String encoder/decoder:: \e$BJ8;zNs$NId9f2=!&I|9f2=\e(B
-* File encoder/decoder:: File \e$B$NId9f2=!&I|9f2=\e(B
+* encoder/decoder:: \e$BId9f2=!&I|9f2=\e(B
+* Encoding information:: Other utilities
+* mel-backend:: How to write encoder/decoder module
+* generic function for mel-backend:: How to add encoding/decoding service
@end menu
-@node Content-Transfer-Encoding parser, Region encoder/decoder, Content-Transfer-Encoding, Content-Transfer-Encoding
+@node Content-Transfer-Encoding parser, encoder/decoder, Content-Transfer-Encoding, Content-Transfer-Encoding
@section Content-Transfer-Encoding \e$BMs$N2r@O4o\e(B
@defun mime-parse-Content-Transfer-Encoding string
-@node Region encoder/decoder, String encoder/decoder, Content-Transfer-Encoding parser, Content-Transfer-Encoding
-@section \e$BNN0h$NId9f2=!&I|9f2=\e(B
+@node encoder/decoder, Encoding information, Content-Transfer-Encoding parser, Content-Transfer-Encoding
+@section \e$BId9f2=!&I|9f2=\e(B
@defun mime-encode-region start end encoding
@end defun
-@defvar mime-encoding-method-alist
-Alist of encoding vs. corresponding method to encode region.@refill
-
-Each element looks like @code{(STRING . FUNCTION)} or @code{(STRING
-. nil)}. @var{string} is content-transfer-encoding. @code{function} is
-region encoder and @code{nil} means not to encode.
-@end defvar
+@defun mime-decode-string string encoding
+@var{string} \e$B$r\e(B @var{encoding} \e$B$H$7$FI|9f$7$?7k2L$rJV$9!#\e(B
+@end defun
-@defvar mime-decoding-method-alist
-Alist of encoding vs. corresponding method to decode region.@refill
-Each element looks like @code{(STRING . FUNCTION)} or @code{(STRING
-. nil)}. @var{string} is content-transfer-encoding. @code{function} is
-region decoder and @code{nil} means not to decode.
-@end defvar
+@defun mime-insert-encoded-file filename encoding
+Insert file @var{FILENAME} encoded by @var{ENCODING} format.
+@end defun
-@node String encoder/decoder, File encoder/decoder, Region encoder/decoder, Content-Transfer-Encoding
-@section \e$BJ8;zNs$NId9f2=!&I|9f2=\e(B
+@defun mime-write-decoded-region start end filename encoding
-@defun mime-decode-string string encoding
+Decode and write current region encoded by @var{encoding} into
+@var{filename}.@refill
-@var{string} \e$B$r\e(B @var{encoding} \e$B$H$7$FI|9f$7$?7k2L$rJV$7$^$9!#\e(B
+@var{start} and @var{end} are buffer positions.
@end defun
-@defvar mime-string-decoding-method-alist
-Alist of encoding vs. corresponding method to decode string.@refill
+@node Encoding information, mel-backend, encoder/decoder, Content-Transfer-Encoding
+@section Other utilities
-Each element looks like @code{(STRING . FUNCTION)}. STRING is
-content-transfer-encoding. FUNCTION is string decoder.
-@end defvar
+@defun mime-encoding-list &optional SERVICE
+Return list of Content-Transfer-Encoding.@refill
+If @var{service} is specified, it returns available list of
+Content-Transfer-Encoding for it.
+@end defun
-@node File encoder/decoder, , String encoder/decoder, Content-Transfer-Encoding
-@section File \e$B$NId9f2=!&I|9f2=\e(B
-@defun mime-insert-encoded-file filename encoding
+@defun mime-encoding-alist &optional SERVICE
-Insert file @var{FILENAME} encoded by @var{ENCODING} format.
+Return table of Content-Transfer-Encoding for completion.@refill
+
+If @var{service} is specified, it returns available list of
+Content-Transfer-Encoding for it.
@end defun
-@defun mime-write-decoded-region start end filename encoding
-Decode and write current region encoded by @var{encoding} into
-@var{filename}.@refill
+@node mel-backend, generic function for mel-backend, Encoding information, Content-Transfer-Encoding
+@section How to write encoder/decoder module
-@var{start} and @var{end} are buffer positions.
-@end defun
+@defmac mel-define-method name args &rest body
+Define @var{name} as a method function of (nth 1 (car (last
+@var{args}))) backend.@refill
-@defvar mime-file-encoding-method-alist
+@var{args} is like an argument list of lambda, but (car (last
+@var{args})) must be specialized parameter. (car (car (last
+@var{args}))) is name of variable and (nth 1 (car (last @var{args}))) is
+name of backend (encoding).@refill
-Alist of encoding vs. corresponding method to insert encoded
-file.@refill
+Example:@refill
-Each element looks like @code{(STRING . FUNCTION)}. STRING is
-content-transfer-encoding. FUNCTION is function to insert encoded file.
-@end defvar
+@lisp
+(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)
+ )))
+@end lisp
+@end defmac
-@defvar mime-file-decoding-method-alist
+@defmac mel-define-method-function spec function
-Alist of encoding vs. corresponding method to write decoded region to
-file.@refill
+Set @var{spec}'s function definition to @var{function}.@refill
-Each element looks like @code{(STRING . FUNCTION)}. STRING is
-content-transfer-encoding. FUNCTION is function to write decoded region
-to file.
-@end defvar
+First element of @var{spec} is service.@refill
+
+Rest of @var{args} is like an argument list of lambda, but (car (last
+@var{args})) must be specialized parameter. (car (car (last
+@var{args}))) is name of variable and (nth 1 (car (last @var{args}))) is
+name of backend (encoding).@refill
+
+Example:@refill
+
+@lisp
+(mel-define-method-function (mime-encode-string string (nil "base64"))
+ 'encode-base64-string)
+@end lisp
+@end defmac
+
+
+
+@node generic function for mel-backend, , mel-backend, Content-Transfer-Encoding
+@section How to add encoding/decoding service
+
+@defmac mel-define-service name &optional args doc-string
+
+Define @var{name} as a service for Content-Transfer-Encodings.@refill
+
+If @var{args} is specified, @var{name} is defined as a generic function
+for the service.@refill
+
+Example:@refill
+
+@lisp
+(mel-define-service encoded-text-encode-string (string encoding)
+ "Encode STRING as encoded-text using ENCODING.
+ENCODING must be string.")
+@end lisp
+@end defmac
@node Header encoder/decoder, , encoded-word, encoded-word
@section Header \e$B$NId9f2=!&I|9f2=\e(B
-@defun eword-encode-header &optional code-conversion separator
+@defun eword-decode-header &optional code-conversion separator
-Decode MIME encoded-words in header fields.@refill
+Header \e$BCf$N\e(B encoded-word \e$B$rI|9f$9$k!#\e(B@refill
-If @var{code-conversion} is @code{nil}, it decodes only encoded-words.
-If it is mime-charset, it decodes non-ASCII bit patterns as the
-mime-charset. Otherwise it decodes non-ASCII bit patterns as the
-default-mime-charset.@refill
+\e$B$b$7\e(B @var{code-conversion} \e$B$,\e(B @code{nil} \e$B$J$i!"\e(Bencoded-word \e$B$@$1$,I|9f$5\e(B
+\e$B$l$k!#$b$7!"\e(B@var{code-conversion} \e$B$,\e(B MIME charset (@ref{MIME charset})
+\e$B$J$i!"Hs\e(B ASCII bit patterns \e$B$O$=$N\e(B MIME charset \e$B$H$7$FI|9f$5$l$k!#$3$l0J\e(B
+\e$B30$N>l9g!"Hs\e(B ASCII bit patterns \e$B$O\e(B@code{default-mime-charset}. \e$B$H$7$FI|\e(B
+\e$B9f$5$l$k!#\e(B(cf. @ref{entity formatting}) @refill
-If @var{separator} is not nil, it is used as header separator.
+\e$B$b$7\e(B @var{separator} \e$B$,\e(B @code{nil} \e$B$G$J$1$l$P!"$=$NCM$,\e(Bheader separator
+\e$B$H$7$FMQ$$$i$l$k!#\e(B
@end defun
@defun eword-encode-header &optional code-conversion
-Encode header fields to network representation, such as MIME
-encoded-word.@refill
+Header \e$B$r\e(B network \e$BI=8=$KId9f2=$9$k!#\e(B@refill
-It refer variable @code{eword-field-encoding-method-alist}.
+\e$B3F\e(B field \e$B$O\e(B @code{eword-field-encoding-method-alist} \e$B$G;XDj$5$l$?J}<0$G\e(B
+\e$BId9f2=$5$l$k!#\e(B
@end defun
+@defvar eword-field-encoding-method-alist
+
+Association list to specify field encoding method. Each element looks
+like (FIELD . METHOD).@refill
+
+If METHOD is @code{mime}, the FIELD will be encoded into MIME format
+(encoded-word).@refill
+
+If METHOD is @code{nil}, the FIELD will not be encoded.@refill
+
+If METHOD is a MIME charset, the FIELD will be encoded as the charset
+when it must be convert into network-code.@refill
+
+Otherwise the FIELD will be encoded as variable
+@code{default-mime-charset} when it must be convert into network-code.
+@end defvar
+
+
@node custom, Appendix, encoded-word, Top
@chapter \e$B0lHL@_Dj\e(B
@end deffn
-@defvar default-mime-charset
-
-\e$BE,@Z$J\e(B MIME charset (@ref{MIME charset}) \e$B$,8+$D$+$i$J$+$C$?>l9g$KMQ$$$i\e(B
-\e$B$l$k\e(BMIME charset.@refill
-
-\e$BK\Mh$O\e(B APEL \e$B$NJQ?t$G$"$k!#\e(B
-@end defvar
-
-
@defvar mime-temp-directory
MIME \e$B5!G=$K4X$9$k<BAu$,0l;~E*$K;HMQ$9$k\e(B file \e$B$r:n@.$9$k\e(B
ASCII (@ref{ASCII}) \e$B$N$_$+$i$J$j\e(B ISO 2022 \e$B$K$h$kId9f3HD%$O5v$5$l$J$$!#\e(B
-Internet message \e$B$K$*$1$kI8=`$NId9f2=J8;z=89g\e(B(@ref{Coded character set})
+Internet message \e$B$K$*$1$kI8=`$NId9f2=J8;z=89g\e(B(@ref{Coded character set})
\e$B$G$"$j!"L@<(E*$K\e(B MIME charset \e$B$,<($5$l$J$$>l9g$O86B'$H$7$F\e(B
@strong{us-ascii} \e$B$,;H$o$l$k!#\e(B@refill
@node History, , CVS, Appendix
@section \e$BNr;K\e(B
-FLIM \e$B$N\e(B code \e$B$N:G8E$NItJ,$O\e(B \e$B1]JB\e(B \e$B;LCR\e(B \e$B;a$,=q$$$?\e(B @file{mime.el}\e$B$K5/8;$7\e(B
+FLIM \e$B$N\e(B code \e$B$N:G8E$NItJ,$O\e(B \e$B1]JB\e(B \e$B;LCR\e(B \e$B;a$,=q$$$?\e(B @file{mime.el} \e$B$K5/8;$7\e(B
\e$B$^$9!#$3$N>.$5$J\e(B program \e$B$O\e(B Nemacs \e$B$GF0:n$9$k\e(B iso-2022-jp \e$B$N\e(B B-encoding
\e$B@lMQ$N\e(B encoded-word \e$B$NI|9f2=%W%m%0%i%`$G$7$?!#\e(B@refill
\e$B8e$K!"\e(BAPEL \e$B$+$i\e(B @file{std11.el} \e$B$,0\$5$l!"$^$?!"\e(B@file{mailcap.el},
@file{eword-decode.el} \e$B$*$h$S\e(B @file{eword-encode.el} \e$B$,\e(B SEMI \e$B$+$i0\$5$l!"\e(B
-package \e$B$NL>A0$,\e(B FLIM\e$B$H$J$j$^$9!#\e(B@refill
+package \e$B$NL>A0$,\e(B FLIM \e$B$H$J$j$^$9!#\e(B@refill
\e$B$3$ND>A0$+$iEDCf\e(B \e$BE/\e(B \e$B;a$,$h$j\e(B RFC \e$B$KCi<B$J<BAu$r=q$-;O$a!"$3$l$O!"8=:_!"\e(B
FLIM \e$B$N;^$G$"$k\e(B ``FLIM-FLAM'' \e$B$H$J$C$F$$$^$9!#\e(B