\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.10 MIME \e$B5!G=@bL@=q\e(B}
@titlepage
-@title FLIM 1.9 MIME \e$B5!G=@bL@=q\e(B
+@title FLIM 1.10 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
@end titlepage
@node Top, Introduction, (dir), (dir)
-@top FLIM 1.9 MIME \e$B5!G=@bL@=q\e(B
+@top FLIM 1.10 MIME \e$B5!G=@bL@=q\e(B
@ifinfo
@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
+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
-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
-\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 hierarchy:: Entity \e$B3,AX\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 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
@node Entity hierarchy, Entity Attributes, 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
-@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
+
+
+@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 buffer, Entity-header, Entity
+@node Entity-content, Entity buffer, entity formatting, Entity
@section Entity \e$B$NFbMF\e(B
@defun mime-entity-content 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$7$^$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
+
+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
-Each element looks like @code{(STRING . FUNCTION)}. STRING is
-content-transfer-encoding. FUNCTION is function to write decoded region
-to file.
-@end defvar
+
+
+@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
@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