1 <!doctype sinfo system>
3 <title>FLIM 1.8 Manual about MIME Features
4 <author>MORIOKA Tomohiko <mail>morioka@jaist.ac.jp</mail>
14 This file documents MIME features of FLIM, a Internet message
15 parsing/encoding library for GNU Emacs.
22 FLIM is a library to provide basic features about message
23 representation or encoding.
26 <h1> How to use MIME features
29 Please eval following to use MIME features provided by FLIM:
36 <h1> Message and Entity
39 According to <dref>RFC 2045</dref>, `The term ``entity'', refers
40 specifically to the MIME-defined header fields and contents of either
41 a message or one of the parts in the body of a multipart entity.' In
42 this document, the term <concept>entity</concept> indicates all of
43 header fields and body.
45 The definition of RFC 2045 indicates that a MIME message is a tree.
46 An message is a tree, each node is an entity, like following figure.
47 Namely MIME extends message to tree structure.
49 FLIM uses <concept>mime-entity</concept> structure to represent
50 information of entity. In this document, it is called simply
53 \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
54 \e$B?<$5$HF1$8?<$5$NCf$N=gHV$K=>$C$FHV9f$,IU$1$k$3$H$,$G$-$^$9!#B($A!"
\e(B
58 \e$B("
\e(B nil
\e$B("
\e(B
60 \e$B(#(!(!(!(!(!(!(!(!(!(+(!(!(!(!(!(!(!(!(!($
\e(B
61 \e$B(#(*($
\e(B
\e$B(#(*($
\e(B
\e$B(#(*($
\e(B
62 \e$B("#0("
\e(B
\e$B("#1("
\e(B
\e$B("#2("
\e(B
63 \e$B(&(((%
\e(B
\e$B(&(((%
\e(B
\e$B(&(((%
\e(B
64 \e$B("
\e(B
\e$B(#(!(!(!(!(+(!(!(!(!($
\e(B
\e$B("
\e(B
65 \e$B(#(!(*(!($(#(!(*(!($(#(!(*(!($(#(!(*(!($(#(!(*(!($
\e(B
66 \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
67 \e$B(&(!(!(!(%(&(!(!(!(%(&(!(!(!(%(&(!(!(!(%(&(!(!(!(%
\e(B
71 <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
72 \e$B$r
\e(B <concept>entity-number</concept>
\e$B$H8F$S$^$9!#
\e(Bentity-number
\e$B$O
\e(B S
\e$B<0$H
\e(B
73 \e$B$7$F$O
\e(B <code>(1 2 3)</code>
\e$B$N$h$&$J@0?t$N%j%9%H$H$7$FI=8=$5$l$^$9!#
\e(B
75 mime-entity
\e$B$G$O!"$3$l$HF1MM$N
\e(B <concept>node-id</concept>
\e$B$rMQ$$$^$9!#
\e(B
76 node-id
\e$B$O$A$g$&$I
\e(B entity-number
\e$B$r5U$K$7$?%j%9%H$G!"
\e(Bentity-number
77 1.2.3
\e$B$KBP1~$9$k
\e(B node-id
\e$B$O
\e(B <code>(3 2 1)</code>
\e$B$G$9!#
\e(B
79 \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
80 \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
81 local
\e$BJQ?t
\e(B <code>mime-message-structure</code>
\e$B$K3JG<$9$k$3$H$K$7$^$9!#
\e(B
82 \e$B$=$7$F!"
\e(Bentity-number
\e$B$d
\e(B node-id
\e$B$rMQ$$$k$3$H$G
\e(B
83 <code>mime-message-structure</code>
\e$B$K$*$1$k
\e(B entity
\e$B$NAjBPE*$J0LCV4X78$r
\e(B
84 \e$B07$&$3$H$,$G$-$^$9!#
\e(B
87 <h2> Functions to create mime-entity
88 <node> Entity creation
90 <defun name="mime-open-entity">
93 Open an entity and return it.
95 <var>type</var> is representation-type. <cf node="mm-backend">
97 <var>location</var> is location of entity. Specification of it is
98 depended on representation-type.
101 <defun name="mime-parse-message">
102 <opts> default-ctl node-id
104 Parse current buffer as message, and return the result as mime-entity.
107 <defun name="mime-parse-buffer">
110 Parse <var>buffer</var> as message, and set the result to buffer local
111 variable <code>mime-message-structure</code> of <var>buffer</var> as
114 If <var>buffer</var> is omitted, current buffer is used.
118 <h2> Features about message tree
119 <node> Entity hierarchy
121 <defvar name="mime-message-structure">
123 Buffer local variable to store mime-entity structure of message.
126 <defun name="mime-entity-children">
129 Return list of entities included in the <var>entity</var>.
132 <defun name="mime-entity-parent">
133 <args> entity <opts> message
135 Return parent entity of the <var>entity</var>.
137 If <var>message</var> is specified, it is regarded as root instead of
138 <code>mime-message-structure</code>.
141 <defun name="mime-root-entity-p">
144 Return non-<code>nil</code> if <var>entity</var> is root entity
148 <defun name="mime-entity-node-id">
151 Return node-id of <var>entity</var>.
154 <defun name="mime-entity-number">
157 Return entity-number of <var>entity</var>.
160 <defun name="mime-find-entity-from-number">
161 <args> entity-number <opts> message
163 Return entity from <var>entity-number</var> in <var>message</var>.
165 If <var>message</var> is not specified,
166 <code>mime-message-structure</code> is used.
169 <defun name="mime-find-entity-from-node-id">
170 <args> entity-node-id <opts> message
172 Return entity from <var>entity-node-id</var> in <var>message</var>.
174 If <var>message</var> is not specified,
175 <code>mime-message-structure</code> is used.
179 <h2> Functions about attributes of mime-entity
180 <node> Entity Attributes
182 <defun name="mime-entity-content-type">
185 Return content-type of <var>entity</var>.
186 <cf node="mime-content-type">
189 <defun name="mime-entity-content-disposition">
192 Return content-disposition of <var>entity</var>. <cf
193 node="mime-content-disposition">
196 <defun name="mime-entity-filename">
199 Return file name of <var>entity</var>.
202 <defun name="mime-entity-encoding">
205 Return content-transfer-encoding of <var>entity</var>.
206 <cf node="Content-Transfer-Encoding">
209 <defun name="mime-entity-cooked-p">
212 Return non-nil if contents of <var>entity</var> has been already
217 <h2> Information of entity header
220 <defun name="mime-fetch-field">
221 <args> field-name <opts> entity
223 Return field-body of <var>field-name</var> field in header of
226 The results is network representation.
228 If <var>entity</var> is omitted, <code>mime-message-structure</code>
229 is used as default value.
231 If <var>field-name</var> field is not found, this function returns
235 <defun name="mime-read-field">
236 <args> field-name <opts> entity
238 Parse <var>field-name</var> field in header of <var>entity</var>, and
241 Format of result is depended on kind of field. For non-structured
242 field, this function returns string. For structured field, it returns
243 list corresponding with structure of the field.
245 Strings in the result will be converted to internal representation of
248 If <var>entity</var> is omitted, <code>mime-message-structure</code>
249 is used as default value.
251 If <var>field-name</var> field is not found, this function returns
255 <defun name="mime-insert-decoded-header">
256 <args> entity <opts> invisible-fields visible-fields
258 Insert before point a decoded contents of header of <var>entity</var>.
260 <var>invisible-fields</var> is list of regexps to match field-name to
261 hide. <var>visible-fields</var> is list of regexps to match
264 If a field-name is matched with some elements of
265 <var>invisible-fields</var> and matched with none of
266 <var>visible-fields</var>, this function don't insert the field.
270 <h2> Contents of Entity
271 <node> Entity-content
273 <defun name="mime-entity-content">
276 Return content of <var>entity</var> as byte sequence.
279 <defun name="mime-write-entity-content">
280 <args> entity filename
282 Write content of <var>entity</var> into <var>filename</var>.
285 <defun name="mime-write-entity">
286 <args> entity filename
288 Write representation of <var>entity</var> into <var>filename</var>.
291 <defun name="mime-write-entity-body">
292 <args> entity filename
294 Write body of <var>entity</var> into <var>filename</var>.
298 <h2> Entity as buffer representation
301 <defun name="mime-entity-buffer">
304 Return buffer, which contains <var>entity</var>.
307 <defun name="mime-entity-point-min">
310 Return the start point of <var>entity</var> in the buffer which
311 contains <var>entity</var>.
314 <defun name="mime-entity-point-max">
317 Return the end point of <var>entity</var> in the buffer which
318 contains <var>entity</var>.
321 <defun name="mime-entity-header-start">
324 Return the start point of header of <var>entity</var> in the buffer
325 which contains <var>entity</var>.
328 <defun name="mime-entity-header-end">
331 Return the end point of header of <var>entity</var> in the buffer
332 which contains <var>entity</var>.
335 <defun name="mime-entity-body-start">
338 Return the start point of body of <var>entity</var> in the buffer
339 which contains <var>entity</var>.
342 <defun name="mime-entity-body-end">
345 Return the end point of body of <var>entity</var> in the buffer which
346 contains <var>entity</var>.
350 <h2> Entity representations and implementations
353 Entity
\e$B$OCj>]2=$5$l$?%G!<%?I=8=$G!"<B:]$N%G!<%?I=8=$H$7$F$OMQES$K1~$8$F
\e(B
354 \e$B$5$^$6$^$J$b$N$,MxMQ$G$-$k$h$&$K@_7W$5$l$F$$$^$9!#
\e(B
356 \e$B$3$3$G!"
\e(Bentity
\e$B$,$I$&$$$&<oN`$NI=8=$r9T$C$F$$$k$+$r<($9$N$,
\e(B
357 <concept>representation-type</concept>
\e$B$G!"
\e(Bentity
\e$B$r@8@.$9$k;~$K$O$3$l$r
\e(B
358 \e$B;XDj$7$^$9!#
\e(B<cf node="Entity Creation">
360 \e$BA0@a$^$G$K=R$Y$FMh$?
\e(B entity
\e$B$KBP$9$k=hM}$O!"
\e(Bentity
\e$B$KBP$7$F$=$N=hM}$r0M
\e(B
361 \e$BMj$9$k$3$H$K$h$C$F<B8=$5$l$F$$$^$9!#
\e(BEntity
\e$B$O<+J,$N
\e(B
362 representation-type
\e$B$rCN$C$F$*$j!"$=$N
\e(B representation-type
\e$B$K1~$8$F<B:]
\e(B
363 \e$B$N=hM}$r9T$&4X?t$r8F$S=P$7$^$9!#$3$N$h$&$J4X?t$r
\e(B <concept>entity
\e$B=hM}
\e(B
364 method</concept>
\e$B$H8F$S$^$9!#$^$?!"
\e(Brepresentation-type
\e$BKh$K$3$N$h$&$J4X
\e(B
365 \e$B?t$r$^$H$a$?$b$N$r
\e(B <concept>mm-backend</concept>
\e$B$H8F$S$^$9!#
\e(B
367 mm-backend
\e$B$O
\e(B representation-type
\e$B$NL>A0$N@hF,$K
\e(B <code>mm</code>
\e$B$H$$$&
\e(B
368 \e$B@\F,<-$rIU$1$?4X?tL>$+$i$J$k
\e(B module
\e$B$G!"$=$N
\e(B module
\e$BL>$OF1MM$K
\e(B
369 representation-type
\e$B$NL>A0$N@hF,$K
\e(B <code>mm</code>
\e$B$rIU$1$?$b$N$K$J$C$F
\e(B
370 \e$B$$$^$9!#$3$N
\e(B module
\e$B$O
\e(B representation-type
\e$B$N
\e(B entity
\e$B$,:G=i$K@8@.$5$l$k
\e(B
371 \e$B;~$K<+F0E*$K
\e(B require
\e$B$5$l$^$9!#
\e(B
374 <h3> Message-passing for entity
375 <node> Request for entity
377 <defun name="mime-entity-send">
378 <args> entity message <rest> args
380 <var>entity</var>
\e$B$K
\e(B <var>message</var>
\e$B$rAw$k!#
\e(B
382 <var>args</var>
\e$B$O
\e(B <var>message</var>
\e$B$N0z?t$G$"$k!#
\e(B
386 <h3> How to make mm-backend
387 <node> mm-backend module
389 \e$B!J$9$_$^$;$s!#$=$N$&$A=q$-$^$9
\e(B (^_^;
\e$B!K
\e(B
391 \e$B!J$H$j$"$($:!"
\e(Bmm*.el
\e$B$r;29M$K$7$F$/$@$5$$!K
\e(B
394 <h1> Information of Content-Type field
397 <concept>Content-Type field</concept> is a field to indicate kind of
398 contents or data format, such as <dref>media-type</dref> and MIME
399 charset. It is defined in <dref>RFC 2045</dref>.
403 Historically, Content-Type field was proposed in RFC 1049. In it,
404 Content-Type did not distinguish type and subtype, and there are no
405 mechanism to represent kind of character code like MIME charset.
409 FLIM
\e$B$O
\e(B Content-Type
\e$BMs$r9=J82r@O$9$k4X?t$H
\e(B Content-Type
\e$BMs$N2r@O7k2L$r
\e(B
410 \e$B3JG<$9$k9=B$BN
\e(B <concept>mime-content-type</concept>
\e$B$rDs6!$7$^$9!#
\e(B
413 <h2> Format of Content-Type field
414 <node> Content-Type field
416 Content-Type
\e$BMs$N7A<0$O0J2<$N$h$&$KDj5A$5$l$F$$$^$9!'
\e(B
419 ``Content-Type'' ``:'' <concept>type</concept> ``/''
420 <concept>subtype</concept> *( ``;'' <concept>parameter</concept> )
427 Content-Type: image/jpeg
436 Content-Type: text/plain; charset=iso-2022-jp
441 \e$B$J$I$N$h$&$KMQ$$$i$l$^$9!#
\e(B
443 \e$B$3$3$G!"
\e(B`type'
\e$B$H
\e(B `subtype'
\e$B$O
\e(B entity
\e$B$N7A<0$r<($9$b$N$G!"N><T$rAm>N$7
\e(B
444 \e$B$F!"
\e(B`media-type'
\e$B$H8F$V$3$H$K$7$^$9!#>e5-$NNc$K$*$1$k
\e(B `image/jpeg'
\e$B$d
\e(B
445 `text/plain'
\e$B$O
\e(B media-type
\e$B$N#1$D$G$9!#
\e(B
449 Content-Type
\e$BMs$N$J$$
\e(B entity
\e$B$O
\e(B
453 Content-Type: text/plain; charset=us-ascii
458 \e$B$H$7$F2r<a$5$l$k!#
\e(B<cf node="us-ascii">
462 <h2> mime-content-type structure
463 <node> mime-content-type
465 <define type="Structure" name="mime-content-type">
467 Content-Type
\e$BMs$N>pJs$r3JG<$9$k$?$a$N9=B$BN!#
\e(B
469 \e$B$3$N9=B$BN$r;2>H$9$k$K$O
\e(B <code>mime-content-type-
\e$BMWAGL>
\e(B</code>
\e$B$H$$$&L>
\e(B
470 \e$BA0$N;2>H4X?t$rMQ$$$k!#
\e(B
472 \e$B$3$N9=B$BN$NMWAG$O0J2<$NDL$j$G$"$k!'
\e(B
475 <dt>primary-type<dd>media-type
\e$B$N<g7?
\e(B (symbol).
477 <dt>subtype<dd>media-type
\e$B$NI{7?
\e(B (symbol).
479 <dt>parameters<dd>Content-Type
\e$BMs$N
\e(B parameter (
\e$BO"A[
\e(B list).
484 <defun name="make-mime-content-type">
487 <p>content-type
\e$B$N@8@.;R!#
\e(B
490 <defun name="mime-content-type-parameter">
491 <args> content-type parameter
493 <var>content-type</var>
\e$B$N
\e(B <var>parameter</var>
\e$B$NCM$rJV$9!#
\e(B
497 <h2> Content-Type
\e$BMs$N2r@O4o
\e(B
498 <node> Content-Type parser
500 <defun name="mime-parse-Content-Type">
503 <var>string</var>
\e$B$r
\e(B content-type
\e$B$H$7$F2r@O$7$?7k2L$rJV$9!#
\e(B
506 <defun name="mime-read-Content-Type">
508 \e$B8=:_$N
\e(B buffer
\e$B$N
\e(B Content-Type
\e$BMs$rFI$_<h$j!"2r@O$7$?7k2L$rJV$9!#
\e(B
510 Content-Type
\e$BMs$,B8:_$7$J$$>l9g$O
\e(B nil
\e$B$rJV$9!#
\e(B
514 <h2> Content-Type
\e$B$K4X$9$kM-MQ$J4X?t
\e(B
515 <node> Content-Type utility
517 <defun name="mime-type/subtype-string">
518 <args> type <opts> subtype
520 <var>type</var>
\e$B$H
\e(B <var>subtype</var>
\e$B$+$i
\e(B type/subtype
\e$B7A<0$NJ8;zNs$rJV
\e(B
525 <h1> Content-Disposition
\e$BMs$N>pJs
\e(B
526 <node> Content-Disposition
528 <concept>Content-Disposition
\e$BMs
\e(B</concept>
\e$B$O
\e(B entity
\e$B$NI=<($d
\e(B file
\e$BL>$J$I
\e(B
529 \e$B$NB0@-$K$J$I$K4X$9$k>pJs$r5-=R$9$k$?$a$N$b$N$G$9!#
\e(B
531 <rfc number="2183" type="Standards Track"
532 author="S. Dorner, K. Moore and R. Troost"
533 title="Communicating Presentation Information in
534 Internet Messages: The Content-Disposition Header"
537 FLIM
\e$B$O
\e(B Content-Disposition
\e$BMs$r9=J82r@O$9$k4X?t$H
\e(B Content-Disposition
538 \e$BMs$N2r@O7k2L$r3JG<$9$k9=B$BN
\e(B
539 <concept>mime-content-disposition</concept>
\e$B$rDs6!$7$^$9!#
\e(B
542 <h2> mime-content-disposition
\e$B9=B$BN
\e(B
543 <node> mime-content-disposition
545 <define type="Structure" name="mime-content-disposition">
547 Content-Disposition
\e$BMs$N2r@O7k2L$r<}$a$k$?$a$N9=B$BN!#
\e(B
549 \e$B$3$N9=B$BN$r;2>H$9$k$K$O
\e(B <code>mime-content-disposition-
\e$BMWAGL>
\e(B</code>
\e$B$H
\e(B
550 \e$B$$$&L>A0$N;2>H4X?t$rMQ$$$k!#
\e(B
552 \e$B$3$N9=B$BN$NMWAG$O0J2<$NDL$j$G$"$k!'
\e(B
555 <dt>disposition-type<dd>disposition-type (symbol).
557 <dt>parameters<dd>Content-Disposition
\e$BMs$N
\e(B parameter (
\e$BO"A[
\e(B list).
562 <defun name="mime-content-disposition-parameter">
563 <args> content-disposition parameter
565 <var>content-disposition</var>
\e$B$N
\e(B <var>parameter</var>
\e$B$NCM$rJV$9!#
\e(B
568 <defun name="mime-content-disposition-filename">
569 <args> content-disposition
571 <var>content-disposition</var>
\e$B$N
\e(B filename
\e$B$NCM$rJV$9!#
\e(B
575 <h2> Content-Disposition
\e$BMs$N2r@O4o
\e(B
576 <node> Content-Disposition parser
578 <defun name="mime-parse-Content-Disposition">
581 <var>string</var>
\e$B$r
\e(B content-disposition
\e$B$H$7$F2r@O$7$?7k2L$rJV$9!#
\e(B
584 <defun name="mime-read-Content-Disposition">
586 \e$B8=:_$N
\e(B buffer
\e$B$N
\e(B Content-Disposition
\e$BMs$rFI$_<h$j!"2r@O$7$?7k2L$rJV$9!#
\e(B
588 Content-Disposition
\e$BMs$,B8:_$7$J$$>l9g$O
\e(B nil
\e$B$rJV$9!#
\e(B
592 <h1>
\e$BId9f2=K!
\e(B
593 <node> Content-Transfer-Encoding
595 <concept>Content-Transfer-Encoding
\e$BMs
\e(B</concept>
\e$B$O
\e(B entity
\e$B$NId9f2=K!$r5-
\e(B
596 \e$B=R$9$k$?$a$N$b$N$G$9!#
\e(B
598 FLIM
\e$B$G$O
\e(B Content-Transfer-Encoding
\e$BMs$r9=J82r@O$9$k4X?t$rDs6!$7$^$9!#$3
\e(B
599 \e$B$l$i$N4X?t$O
\e(B Content-Transfer-Encoding
\e$BMs$N>pJs$OJ8;zNs$GI=8=$7$^$9!#
\e(B
601 \e$B$^$?!"
\e(BContent-Transfer-Encoding
\e$B$K4p$E$$$FId9f2=!&I|9f2=$r9T$&4X?t$bDs
\e(B
605 <h2> Content-Transfer-Encoding
\e$BMs$N2r@O4o
\e(B
606 <node> Content-Transfer-Encoding parser
608 <defun name="mime-parse-Content-Transfer-Encoding">
611 <var>string</var>
\e$B$r
\e(B content-transfer-encoding
\e$B$H$7$F2r@O$7$?7k2L$rJV$9!#
\e(B
614 <defun name="mime-read-Content-Transfer-Encoding">
615 <opts>default-encoding
617 \e$B8=:_$N
\e(B buffer
\e$B$N
\e(B Content-Transfer-Encoding
\e$BMs$rFI$_<h$j!"2r@O$7$?7k2L$r
\e(B
620 Content-Transfer-Encoding
\e$BMs$,B8:_$7$J$$>l9g$O
\e(B
621 <var>default-encoding</var>
\e$B$rJV$9!#
\e(B
625 <h2>
\e$BNN0h$NId9f2=!&I|9f2=
\e(B
626 <node> Region encoder/decoder
628 <defun name="mime-encode-region">
629 <args> start end encoding
631 Encode region <var>start</var> to <var>end</var> of current buffer
632 using <var>encoding</var>.
635 <defun name="mime-decode-region">
636 <args> start end encoding
638 Decode region <var>start</var> to <var>end</var> of current buffer
639 using <var>encoding</var>.
642 <defvar name="mime-encoding-method-alist">
644 Alist of encoding vs. corresponding method to encode region.
646 Each element looks like <code>(STRING . FUNCTION)</code> or
647 <code>(STRING . nil)</code>. <var>string</var> is
648 content-transfer-encoding. <code>function</code> is region encoder
649 and <code>nil</code> means not to encode.
652 <defvar name="mime-decoding-method-alist">
654 Alist of encoding vs. corresponding method to decode region.
656 Each element looks like <code>(STRING . FUNCTION)</code> or
657 <code>(STRING . nil)</code>. <var>string</var> is
658 content-transfer-encoding. <code>function</code> is region decoder
659 and <code>nil</code> means not to decode.
663 <h2>
\e$BJ8;zNs$NId9f2=!&I|9f2=
\e(B
664 <node> String encoder/decoder
666 <defun name="mime-decode-string">
667 <args> string encoding
669 <var>string</var>
\e$B$r
\e(B <var>encoding</var>
\e$B$H$7$FI|9f$7$?7k2L$rJV$7$^$9!#
\e(B
672 <defvar name="mime-string-decoding-method-alist">
674 Alist of encoding vs. corresponding method to decode string.
676 Each element looks like <code>(STRING . FUNCTION)</code>.
677 STRING is content-transfer-encoding.
678 FUNCTION is string decoder.
682 <h2> File
\e$B$NId9f2=!&I|9f2=
\e(B
683 <node> File encoder/decoder
685 <defun name="mime-insert-encoded-file">
686 <args> filename encoding
688 Insert file <var>FILENAME</var> encoded by <var>ENCODING</var> format.
691 <defun name="mime-write-decoded-region">
692 <args> start end filename encoding
694 Decode and write current region encoded by <var>encoding</var> into
697 <var>start</var> and <var>end</var> are buffer positions.
700 <defvar name="mime-file-encoding-method-alist">
702 Alist of encoding vs. corresponding method to insert encoded file.
704 Each element looks like <code>(STRING . FUNCTION)</code>. STRING is
705 content-transfer-encoding. FUNCTION is function to insert encoded
709 <defvar name="mime-file-decoding-method-alist">
711 Alist of encoding vs. corresponding method to write decoded region to
714 Each element looks like <code>(STRING . FUNCTION)</code>. STRING is
715 content-transfer-encoding. FUNCTION is function to write decoded
720 <h1> Header
\e$B$N
\e(B network
\e$BI=8=
\e(B
723 encoded-word
\e$B$O
\e(B header
\e$B$GHs
\e(B <dref>ASCII</dref>
\e$BJ8;z$rI=8=$9$k$?$a$N7A
\e(B
724 \e$B<0$G!"
\e(B<concept>RFC 2047</concept>
\e$B$GDj5A$5$l$F$$$^$9!#
\e(B
726 <rfc number="2047" type="Standards Track" author="K. Moore"
727 title="MIME (Multipurpose Internet Mail Extensions) Part
728 Three: Message Header Extensions for Non-ASCII Text"
729 date="November 1996" obsolete="1521,1522,1590">
731 \e$B$^$?!"9T57$N0-$$$3$H$@$H8@$($^$9$,!"
\e(Bencoded-word
\e$B$rMQ$$$:$KHs
\e(B
732 <dref>ASCII</dref>
\e$BJ8;z$r
\e(B header
\e$B$KF~$l$?5-;v$bB8:_$7$^$9!#
\e(B
734 FLIM
\e$B$O$3$l$i$rId9f2=!&I|9f2=$9$k5!G=$rDs6!$7$^$9!#
\e(B
737 <h2> Header
\e$B$NId9f2=!&I|9f2=
\e(B
738 <node> Header encoder/decoder
740 <defun name="eword-encode-header">
741 <opts> code-conversion separator
743 Decode MIME encoded-words in header fields.
745 If <var>code-conversion</var> is <code>nil</code>, it decodes only
746 encoded-words. If it is mime-charset, it decodes non-ASCII bit
747 patterns as the mime-charset. Otherwise it decodes non-ASCII bit
748 patterns as the default-mime-charset.
750 If <var>separator</var> is not nil, it is used as header separator.
753 <defun name="eword-encode-header">
754 <opts> code-conversion
756 Encode header fields to network representation, such as MIME
759 It refer variable <code>eword-field-encoding-method-alist</code>.
763 <h1>
\e$B0lHL@_Dj
\e(B
766 <define type="group" name="mime">
768 MIME
\e$B4XO"5!G=$K4X$9$k
\e(B group.
770 <code>mail</code>
\e$B$H
\e(B <code>news</code>
\e$B$KB0$9$k!#
\e(B
773 <defvar name="default-mime-charset">
775 \e$BE,@Z$J
\e(B <dref>MIME charset</dref>
\e$B$,8+$D$+$i$J$+$C$?>l9g$KMQ$$$i$l$k
\e(B
778 \e$BK\Mh$O
\e(B APEL
\e$B$NJQ?t$G$"$k!#
\e(B
781 <defvar name="mime-temp-directory">
783 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 directory.
785 \e$B4D6-JQ?t
\e(B <code>MIME_TMP_DIR</code>, <code>TM_TMP_DIR</code>,
786 <code>TMPDIR</code>, <code>TMP</code>
\e$B$b$7$/$O
\e(B <code>TEMP</code>
\e$B$,@_Dj
\e(B
787 \e$B$5$l$F$$$?>l9g!"$=$l$r=i4|CM$H$7$FMQ$$$k!#2?$b@_Dj$5$l$F$$$J$$>l9g!"
\e(B
788 <code>"/tmp/"</code>
\e$B$rMQ$$$k!#
\e(B
801 <concept>7bit</concept> means any integer between 0 .. 127.
803 Any data represented by 7bit integers is called <concept>7bit
806 Textual string consisted of Control characters between 0 .. 31 and
807 127, and space represented by 32, and graphic characters between 33
808 .. 236 are called <concept>7bit (textual) string</concept>.
810 Conventional Internet <a node="MTA">MTA</a> can translate 7bit data,
811 so it is no need to translate by <a
812 node="Quoted-Printable">Quoted-Printable</a> or <a
813 node="Base64">Base64</a> for 7bit data.
815 However if there are too long lines, it can not translate by 7bit MTA
816 even if it is 7bit data. <dref>RFC 821</dref> and <dref>RFC
817 2045</dref> require lines in 7bit data must be less than 998 bytes.
818 So if a ``7bit data'' has a line more than 999 bytes, it is regarded
819 as <dref>binary</dref>. For example, Postscript file should be
820 encoded by Quoted-Printable.
826 <concept>8bit</concept> means any integer between 0 .. 255.
828 Any data represented by 8bit integers is called <concept>8bit
831 Textual string consisted of Control characters between 0 .. 31, 127,
832 and 128 .. 159, and space represented by 32, and graphic characters
833 between 33 .. 236 and 160 .. 255 are called <concept>8bit (textual)
836 For example, <dref>iso-8859-1</dref> or <dref>euc-kr</dref> are
837 coded-character-set represented by 8bit textual string.
839 Traditional Internet <a node="MTA">MTA</a> can translate only
840 <dref>7bit</dref> data, so if a 8bit data will be translated such MTA,
841 it must be encoded by <dref>Quoted-Printable</dref> or
844 However 8bit MTA are increasing today.
846 However if there are too long lines, it can not translate by 8bit MTA
847 even if it is 8bit data. <dref>RFC 2045</dref> require lines in 8bit
848 data must be less than 998 bytes. So if a ``8bit data'' has a line
849 more than 999 bytes, it is regarded as <dref>binary</dref>, so it must
850 be encoded by Base64 or Quoted-Printable.
856 <concept>ASCII</concept> is a 94-character set contains primary latin
857 characters (A-Z, a-z), numbers and some characters. It is a standard
858 of the United States of America. It is a variant of <a node="ISO
861 <standard abbrev="ASCII" title-en="Coded Character Set -- 7-Bit
862 American Standard Code for Information Interchange"
863 number="ANSI X3.4" year="1986">
869 <concept>Base64</concept> is a transfer encoding method of
870 <dref>MIME</dref> defined in <dref>RFC 2045</dref>.
872 The encoding process represents 24-bit groups of input bits as output
873 strings of 4 encoded characters. Encoded characters represent integer
874 0 .. 63 or <concept>pad</concept>. Base64 data must be 4 * n bytes,
875 so pad is used to adjust size.
877 These 65 characters are subset of all versions of ISO 646, including
878 US-ASCII, and all versions of EBCDIC. So it is safe even if it is
879 translated by non-Internet gateways.
885 Any byte stream is called <concept>binary</concept>.
887 It does not require structureof lines. It differs from from <a
888 node="8bit">8bit</a>.
890 In addition, if line structured data contain too long line (more than
891 998 bytes), it is regarded as binary.
894 <h3> Coded character set, Character code
895 <node> coded character set
897 A set of unambiguous rules that establishes a character set and the
898 one-to-one relationship between the characters of the set and their
905 <concept>media-type</concept> specifies the nature of the data in the
906 body of <dref>MIME</dref> <dref>entity</dref>. It consists of
907 <concept>type</concept> and <concept>subtype</concept>. It is defined
908 in <dref>RFC 2046</dref>.
910 Currently there are following standard primary-types:
913 <li><concept>text</concept>
915 <li><concept>image</concept>
917 <li><concept>audio</concept>
919 <li><concept>video</concept>
921 <li><concept>application</concept>
923 <li><a node="multipart"><concept>multipart</concept></a>
925 <li><concept>message</concept>
929 And there are various subtypes, for example, application/octet-stream,
930 audio/basic, image/jpeg, <dref>multipart/mixed</dref>,
931 <dref>text/plain</dref>, video/mpeg...
934 You can refer registered media types at <a
935 href="ftp://ftp.isi.edu/in-notes/iana/assignments/media-types">MEDIA
938 In addition, you can use private type or subtype using
939 <concept>x-token</concept>, which as the prefix `x-'. However you can
940 not use them in public.
942 <cf node="Content-Type field">
948 In this document, it means mail defined in <dref>RFC 822</dref> and
949 news message defined in <dref>RFC 1036</dref>.
955 MIME stands for <concept>Multipurpose Internet Mail
956 Extensions</concept>, it is an extension for <dref>RFC 822</dref>.
958 According to RFC 2045:
960 STD 11, RFC 822, defines a message representation protocol specifying
961 considerable detail about US-ASCII message headers, and leaves the
962 message content, or message body, as flat US-ASCII text. This set of
963 documents, collectively called the Multipurpose Internet Mail
964 Extensions, or MIME, redefines the format of messages to allow for
967 <li>textual message bodies in character sets other than US-ASCII,
969 <li>an extensible set of different formats for non-textual message
972 <li>multi-part message bodies, and
974 <li>textual header information in character sets other than US-ASCII.
978 It is defined in <dref>RFC 2045</dref>, <dref>RFC 2046</dref>, <a
979 node="encoded-word">RFC 2047</a>, <dref>RFC 2048</dref> and <dref>RFC
986 <a node="coded character set">Coded character set</a> used in
987 <dref>Content-Type field</dref> or charset parameter of <a
988 node="encoded-word">encoded-word</a>.
990 It is defined in <dref>RFC 2045</dref>.
992 <dref>iso-2022-jp</dref> or <dref>euc-kr</dref> are kinds of it. (In
993 this document, MIME charsets are written by small letters to
994 distinguish <dref>graphic character set</dref>. For example, ISO
995 8859-1 is a graphic character set, and iso-8859-1 is a MIME charset)
1001 <concept>Message Transfer Agent</concept>. It means mail transfer
1002 programs (ex. sendmail) and news servers.
1010 <concept>Message User Agent</concept>. It means mail readers and news
1016 <h3> Quoted-Printable
1017 <node> Quoted-Printable
1019 <concept>Quoted-Printable</concept> is a transfer encoding method of
1020 <dref>MIME</dref> defined in <dref>RFC 2045</dref>.
1022 If the data being encoded are mostly US-ASCII text, the encoded form
1023 of the data remains largely recognizable by humans.
1031 A RFC defines format of Internet mail message, mainly <concept>message
1036 news message is based on RFC 822, so <concept>Internet
1037 message</concept> may be more suitable than <concept>Internet
1041 <rfc number="822" type="STD 11" author="D. Crocker" title="Standard
1042 for the Format of ARPA Internet Text Messages"
1049 A RFC defines format of USENET message. It is a subset of <dref>RFC
1050 822</dref>. It is not Internet standard, but a lot of netnews
1051 excepting Usenet uses it.
1053 <rfc name="USENET" number="1036" author="M. Horton and R. Adams"
1054 title="Standard for Interchange of USENET Messages"
1055 date="December 1987" obsolete="850">
1061 <rfc number="2045" type="Standards Track" author="N. Freed and
1062 N. Borenstein" title="Multipurpose Internet Mail
1063 Extensions (MIME) Part One: Format of Internet Message
1064 Bodies" date="November 1996" obsolete="1521, 1522,
1071 <rfc number="2046" type="Standards Track" author="N. Freed and
1072 N. Borenstein" title="Multipurpose Internet Mail
1073 Extensions (MIME) Part Two: Media Types"
1074 date="November 1996" obsolete="1521, 1522, 1590">
1080 <rfc number="2048" type="Standards Track" author="N. Freed, J. Klensin
1081 and J. Postel" title="Multipurpose Internet Mail
1082 Extensions (MIME) Part Four: Registration Procedures"
1083 date="November 1996" obsolete="1521, 1522, 1590">
1089 <rfc number="2049" type="Standards Track" author="N. Freed and
1090 N. Borenstein" title="Multipurpose Internet Mail
1091 Extensions (MIME) Part Five: Conformance Criteria and
1092 Examples" date="November 1996" obsolete="1521, 1522,
1099 A textual data represented by only <dref>coded character set</dref>.
1100 It does not have information about font or typesetting.
1101 <cf node="text/plain">
1107 A <a node="MIME charset">MIME charset</a> for primary Latin script
1108 mainly written by English or other languages.
1110 It is a 7bit <dref>coded character set</dref> based on <dref>ISO
1111 2022</dref>, it contains only
1112 <dref>ASCII</dref> and <dref>code extension</dref> is not allowed.
1114 It is standard coded character set of Internet mail. If MIME charset
1115 is not specified, <concept>us-ascii</concept> is used as default.
1117 In addition, <concept>ASCII</concept> of <dref>RFC 822</dref> should
1118 be interpreted as us-ascii.
1121 <h2> How to report bugs
1124 If you write bug-reports and/or suggestions for improvement, please
1125 send them to the tm Mailing List:
1128 <li> Japanese <mail>bug-tm-ja@chamonix.jaist.ac.jp</mail>
1129 <li> English <mail>bug-tm-en@chamonix.jaist.ac.jp</mail>
1133 Notice that, we do not welcome bug reports about too old version.
1134 Bugs in old version might be fixed. So please try latest version at
1137 You should write <concept>good bug report</concept>. If you write
1138 only ``FLIM does not work'', we can not find such situations. At
1139 least, you should write name, type, variants and version of OS, emacs,
1140 APEL, FLIM, SEMI and MUA, and setting. In addition, if error occurs,
1141 to send backtrace is very important. <cf file="emacs" node="Bugs">
1143 Bug may not appear only your environment, but also in a lot of
1144 environment (otherwise it might not bug). Therefor if you send mail
1145 to author directly, we must write a lot of mails. So please send mail
1146 to address for tm bugs instead of author.
1149 Via the tm ML, you can report FLIM bugs, obtain the latest release of
1150 FLIM, and discuss future enhancements to FLIM. To join the tm ML,
1151 send empty e-mail to:
1154 <li> Japanese <mail>tm-ja-help@chamonix.jaist.ac.jp</mail>
1155 <li> English <mail>tm-en-help@chamonix.jaist.ac.jp</mail>
1159 <h2> CVS based development
1162 FLIM
\e$B$N
\e(B file
\e$B$O
\e(B CVS
\e$B$r;H$C$F4IM}$5$l$F$$$^$9!#$3$N$?$a!"0J2<$NJ}K!$G:G
\e(B
1163 \e$B?7$N
\e(B FLIM
\e$B$rF~<j$9$k$3$H$,$G$-$^$9!'
\e(B
1168 % cvs -d :pserver:anonymous@chamonix.jaist.ac.jp:/hare/cvs/root \
1171 CVS password: [CR] # NULL string
1175 % cvs -d :pserver:anonymous@chamonix.jaist.ac.jp:/hare/cvs/root \
1176 checkout [-r TAG] flim
1180 CVS
\e$B$rMQ$$$?3+H/$K;22C$7$?$$J}$O
\e(B
1183 <li> <mail>cvs@chamonix.jaist.ac.jp</mail>
1187 \e$B$^$G!"
\e(Baccount
\e$BL>$H
\e(B UNIX
\e$B$N
\e(B passwd
\e$B$HF1$87A<0$N
\e(B crypt
\e$B2=$5$l$?
\e(B password
1188 \e$B$r1h$($F8fO"Mm$/$@$5$$!#
\e(B
1191 <h2> History of FLIM
1194 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</file>
1195 \e$B$K5/8;$7$^$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
1196 B-encoding
\e$B@lMQ$N
\e(B encoded-word
\e$B$NI|9f2=%W%m%0%i%`$G$7$?!#
\e(B
1198 \e$B$=$N8e!"<i2,
\e(B
\e$BCNI'
\e(B
\e$B$O
\e(B <file>mime.el</file>
\e$B$r85$K
\e(B
1199 <file>tiny-mime.el</file>
\e$B$H$$$&%W%m%0%i%`$r=q$-$^$9!#$3$l$O!"
\e(BNemacs
1200 \e$B$H
\e(B Mule
\e$B$GF0:n$9$k
\e(B encoded-word
\e$B$NId9f2=!&I|9f2=%W%m%0%i%`$G$7$?!#
\e(B
1201 <file>tiny-mime.el</file>
\e$B$O
\e(B B-encoding
\e$B$@$1$G$J$/
\e(B Q-encoding
\e$B$b
\e(B
1202 support
\e$B$7!"$^$?!"
\e(BMULE
\e$B$G07$&$3$H$,$G$-$k$5$^$6$^$J
\e(B <dref>MIME
1203 charset</dref>
\e$B$rF1;~$K;H$&$3$H$,$G$-$^$7$?!#$3$N;~!"
\e(BNemacs
\e$B$H
\e(B Mule
\e$B$N
\e(B
1204 \e$BAPJ}$r
\e(B support
\e$B$9$k$?$a$KMQ$$$i$l$?%F%/%K%C%/$O8e$K
\e(B emu package
\e$B$K$^$H
\e(B
1205 \e$B$a$i$l$^$9!#
\e(B
1207 \e$B$3$N:"!"<i2,
\e(B
\e$BCNI'
\e(B
\e$B$O
\e(B <file>tiny-mime.el</file>
\e$B$r$5$^$6$^$J
\e(B MUA
\e$B$G;H$&
\e(B
1208 \e$B$?$a$N@_Dj=8$bG[I[$7$F$$$^$7$?$,!"$=$l$i$O8e$K
\e(B
1209 <file>tiny-mime.el</file>
\e$B$H$H$b$K#1$D$N
\e(B package
\e$B$K$^$H$a$i$l!"
\e(Btm
\e$B$H$$
\e(B
1210 \e$B$&L>A0$GG[I[$5$l$^$9!#
\e(B
1212 \e$B<i2,
\e(B
\e$BCNI'
\e(B
\e$B$O$d$,$F!"
\e(BMIME message
\e$B$r1\Mw$9$k$?$a$N%W%m%0%i%`$G$"$k
\e(B
1213 <file>tm-body.el</file>
\e$B$r=q$-$^$9!#$3$l$O!"$9$0$K
\e(B
1214 <file>tm-view.el</file>
\e$B$H$$$&L>A0$KJQ$o$j$^$7$?$,!"$d$,$F!"$3$l$,
\e(B
1215 <file>tiny-mime.el</file>
\e$B$KBe$o$C$F!"
\e(Btm
\e$B$NCf3K$H$J$j$^$9!#
\e(B
1217 <file>tm-view.el</file>
\e$B$OEvA3!"
\e(BContent-Transfer-Encoding
\e$B$r07$&I,MW$,
\e(B
1218 \e$B$"$j$^$9!#$3$NL\E*$N$?$a$K!"
\e(BMEL
\e$B$,@0Hw$5$l$O$8$a$^$7$?!#
\e(BBase64
\e$B$K4X$7
\e(B
1219 \e$B$F$O
\e(B <file>tiny-mime.el</file>
\e$B$N
\e(B code
\e$B$,0\$5$l!"$^$?!"?7$?$K
\e(B
1220 Quoted-Printable
\e$B$N
\e(B code
\e$B$,DI2C$5$l$^$7$?!#$3$l$i$,
\e(B
1221 <file>mel-b.el</file>
\e$B$H
\e(B <file>mel-q.el</file>
\e$B$K$J$j$^$7$?!#
\e(B
1223 \e$B$^$?!"8e$K!"<i2,
\e(B
\e$BCNI'
\e(B
\e$B$K$h$C$F
\e(B uuencode
\e$BMQ$N
\e(B <file>mel-u.el</file>
\e$B$,
\e(B
1224 \e$BDI2C$5$l!"$=$N8e$K!">.NS
\e(B
\e$B=$J?
\e(B
\e$B;a$K$h$C$F
\e(B x-gzip64
\e$BMQ$N
\e(B
1225 <file>mel-g.el</file>
\e$B$,DI2C$5$l$^$7$?!#
\e(B
1227 tm
\e$B$G$O8e$K!"<i2,
\e(B
\e$BCNI'
\e(B
\e$B$K$h$C$F
\e(B <file>tiny-mime.el</file>
\e$B$N:F<BAu$,9T
\e(B
1228 \e$B$o$l!"$3$N2aDx$G!"
\e(BSTD 11
\e$B$N
\e(B parser
\e$B$,=q$+$l$^$7$?!#$3$l$O!"8=:_$N
\e(B
1229 <file>std11.el</file>
\e$B$KEv$?$j$^$9!#$^$?!"$3$N2aDx$G
\e(B
1230 <file>tiny-mime.el</file>
\e$B$OI|9f2=$r9T$&
\e(B <file>tm-ew-d.el</file>
\e$B$HId
\e(B
1231 \e$B9f2=$r9T$&
\e(B <file>tm-ew-e.el</file>
\e$B$KJ,$1$i$l$^$7$?!#$3$NN><T$,8=:_$N
\e(B
1232 <file>eword-decode.el</file>
\e$B$H
\e(B <file>eword-encode.el</file>
\e$B$N@hAD$K
\e(B
1233 \e$BEv$?$j$^$9!#
\e(B
1235 \e$B8e$K!"<i2,
\e(B
\e$BCNI'
\e(B
\e$B$i$K$h$C$F
\e(B tm
\e$B$NA4LL=q$-49$(:n6H$,9T$o$l!"$3$N2aDx$G!"
\e(B
1236 tm
\e$B$O
\e(B APEL, MEL, SEMI, EMH, RMAIL-MIME, Gnus-MIME
\e$B$J$I$KJ,$1$i$l$^$7$?!#
\e(B
1237 \e$B$3$N$&$A$N
\e(B MEL
\e$B$,
\e(B FLIM
\e$B$ND>@\$N@hAD$KEv$?$j$^$9!#
\e(B
1239 \e$B8e$K!"
\e(BAPEL
\e$B$+$i
\e(B <file>std11.el</file>
\e$B$,0\$5$l!"$^$?!"
\e(B
1240 <file>mailcap.el</file>, <file>eword-decode.el</file>
\e$B$*$h$S
\e(B
1241 <file>eword-encode.el</file>
\e$B$,
\e(B SEMI
\e$B$+$i0\$5$l!"
\e(Bpackage
\e$B$NL>A0$,
\e(B FLIM
1242 \e$B$H$J$j$^$9!#
\e(B
1244 \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
1245 FLIM
\e$B$N;^$G$"$k
\e(B ``FLIM-FLAM''
\e$B$H$J$C$F$$$^$9!#
\e(B
1249 <node> Concept Index
1255 <node> Function Index
1261 <node> Variable Index