tm 7.105.1.
[elisp/tm.git] / doc / tm-view-en.texi
1 \input texinfo.tex
2 @setfilename tm-view-en.info
3 @settitle{tm-view 7.80 Reference Manual (English Version)}
4 @titlepage
5 @title tm-view 7.80 Reference Manual (English Version)
6 @author MORIOKA Tomohiko <morioka@@jaist.ac.jp>
7 @subtitle 1997/1/31
8 @end titlepage
9 @node Top, Introduction, (dir), (dir)
10 @top tm-view 7.80 Reference Manual (English Version)
11
12 @ifinfo
13
14 This file documents tm-view, a MIME Viewer for GNU Emacs.
15 @end ifinfo
16
17 @menu
18 * Introduction::                What is tm-view?
19 * MIME display::                Structure of display in mime/viewer-mode
20 * mime/viewer-mode::            Navigation in mime/viewer-mode
21 * method::                      Mechanism of decoding
22 * Two buffers for an article::  raw-article-buffer and preview-buffer
23 * API::                         Functions to decode MIME message
24 * Acknowledgments::             
25 * Concept Index::               
26 * Function Index::              
27 * Variable Index::              
28 @end menu
29
30 @node Introduction, MIME display, Top, Top
31 @chapter What is tm-view?
32 @cindex filter
33 @cindex method
34
35 The tm-view is a general MIME viewer running on GNU Emacs.@refill
36
37 tm-view provides the major-mode called @code{mime/viewer-mode}
38 (@ref{mime/viewer-mode}) to read MIME message for MUA.  MUA
39 (@ref{(tm-en)MUA}) implementer can use it to add MIME function.@refill
40
41 tm-view is a user interface kernel to view and navigate MIME message.
42 tm-view drives some programs to navigate each content-type
43 (@ref{(tm-en)content-type})s, they are called @strong{method}
44 (@ref{method}).  tm-view calls some programs to display each contents
45 and headers in preview buffer, they are called @strong{filter} (@ref{Two buffers for an article}).  Method and filters are tm-view application
46 program.  They expand tm-view to treat various kinds of MIME types.
47
48
49 @node MIME display, mime/viewer-mode, Introduction, Top
50 @chapter Structure of display in mime/viewer-mode
51
52 In mime/viewer-mode (@ref{mime/viewer-mode}), following are displayed
53 for each parts:@refill
54
55 @example
56         [content-button]
57         (content-header)
58         
59         (content-body)
60         (content-separator)
61 @end example
62
63 You can change design or stop to display if you specify for each
64 conditions, such as content-types.@refill
65
66 Example:
67
68 @example
69 From: morioka@@jaist.ac.jp (MORIOKA Tomohiko)
70 Subject: Re: Question
71 Newsgroups: zxr.message.mime
72 Date: 22 Oct 93 11:02:44
73 Mime-Version: 1.0
74 Organization: Japan Advanced Institute of Science and Technology,
75         Ishikawa, Japan
76
77 [1  (text/plain)]
78   How to compose MIME message in MIME-Edit mode.
79
80   Press `C-c C-x ?' then help message will be displayed:
81
82 C-c C-x C-t     insert a text message.
83 C-c C-x TAB     insert a (binary) file.
84 C-c C-x C-e     insert a reference to external body.
85 C-c C-x C-v     insert a voice message.
86 C-c C-x C-y     insert a mail or news message.
87 C-c C-x RET     insert a mail message.
88 C-c C-x C-s     insert a signature file at end.
89 C-c C-x t       insert a new MIME tag.
90 C-c C-x a       enclose as multipart/alternative.
91 C-c C-x p       enclose as multipart/parallel.
92 C-c C-x m       enclose as multipart/mixed.
93 C-c C-x d       enclose as multipart/digest.
94 C-c C-x s       enclose as PGP signed.
95 C-c C-x e       enclose as PGP encrypted.
96 C-c C-x C-k     insert PGP public key.
97 C-c C-x C-p     preview editing MIME message.
98 ...
99
100 So press `C-c C-x C-i' and specify file name you want to include.
101
102   MIME encoding for binary file is normally Base64.
103
104 [2  (image/gif)]
105
106 [3  (text/plain)]
107
108   In this way, it is finish a message attaching a picture.
109
110 ======================== A cup of Russian tea ========================
111 ============  * not by jam, not by marmalade, by honey *  ============
112 ============               MORIOKA Tomohiko               ============
113 =============== Internet E-mail: <morioka@@jaist.ac.jp> ===============
114 @end example
115
116
117
118 @menu
119 * content-button::              
120 * content-header::              
121 * content-body::                
122 * content-separator::           
123 @end menu
124
125 @node content-button, content-header, MIME display, MIME display
126 @section content-button
127 @cindex content-number
128
129 content-subject displays abstract for the part.  It is placed in top of
130 the part.@refill
131
132 In default, it is displayed following design:
133
134 @example
135         [1.3 test (text/plain)]
136 @end example
137
138
139 First number field represents position of a content in the part.  It is
140 called @strong{content-number}.  It can be considered as the chapter
141 number in the message.@refill
142
143 Second string part represents title.  It is created by following:
144
145 @enumerate
146 @item
147 name paramater or x-name parameter in Content-Type field
148 (@ref{(tm-en)Content-Type field})
149 @item
150 Content-Description field (@ref{(tm-en)Content-Description field}) or
151 Subject field
152 @item
153  filename of uuencode
154 @end enumerate
155
156
157 If they are not exists, space is displayed.@refill
158
159 Third parenthesis part represents content-type/subtype of the part.  If
160 it is non-MIME part, @code{nil} is displayed.@refill
161
162 Content-button is used like icon when content-header
163 (@ref{content-header}) and content-body (@ref{content-body}) are hidden.
164 For example:
165
166 @example
167         [2  (image/gif)]
168 @end example
169
170 @noindent
171 if you press @kbd{v} key, GIF image is displayed.
172
173 If mouse operations are available, you can press content-button by mouse
174 button-2 (center button of 3 button-mouse) to play, similarly to press
175 @kbd{v} key. (cf. @ref{mime/viewer-mode}) @refill
176
177 By the way, it is annoying to display content-button if content-header
178 is displayed.  So tm-view provides a mechanism to specify conditions
179 to display content-button.
180
181
182 @defvar mime-viewer/content-button-ignored-ctype-list
183
184 List of content-types.@refill
185
186 If content-type of a part is a member of this list, its content-button
187 is not displayed.
188 @end defvar
189
190
191
192 @node content-header, content-body, content-button, MIME display
193 @section content-header
194 @cindex content-header-filter
195
196 A content header displays the header portion of a part in the
197 preview-buffer.  However it is annoying to display header for every
198 parts, so tm-view provides a mechanism to specify its condition.@refill
199
200 When the function @code{mime-viewer/header-visible-p} returns @code{t}
201 for reversed-content-number of a part, content-header is
202 displayed.@refill
203
204 This judge function returns @code{t} when a part is root or content-type
205 of its parent is a member of the variable
206 @code{mime-viewer/childrens-header-showing-Content-Type-list}.@refill
207
208 If you want to change this condition, please redefine it.  Notice that
209 it refers variable
210 @code{mime-viewer/childrens-header-showing-Content-Type-list}, however
211 if you redefine function @code{mime-viewer/header-visible-p}, it may not
212 work.  So if you want to redefine it, it should be refer variable
213 @code{mime-viewer/childrens-header-showing-Content-Type-list}.@refill
214
215 When content-header is displayed, content-header are formated by the
216 program called by @strong{content-header-filter}.  Content-header-filter
217 is searched from variable
218 @code{mime-viewer/content-header-filter-alist}.  Its key is major-mode
219 of the raw-article-buffer (@ref{raw-article-buffer}).  If not found,
220 function @code{mime-viewer/default-content-header-filter} is
221 called.@refill
222
223
224 @defvar mime-viewer/childrens-header-showing-Content-Type-list
225
226 List of content-types.  If content-type of parent of a part is a member
227 of this variable, its content-header is displayed.  Default value is
228 @code{'("message/rfc822" "message/news")}.@refill
229
230 This variable is referred by the function
231 @code{mime-viewer/header-visible-p}.
232 @end defvar
233
234
235
236 @defun mime-viewer/header-visible-p rcnum cinfo  &optional  ctype
237
238 Returns @code{t} if a part which reversed-content-number is @var{rcnum}
239 in content-info @var{cinfo} is displayed.@refill
240
241 If you know content-type, you can specify by @var{ctype}.
242 @end defun
243
244
245
246 @defvar mime-viewer/content-header-filter-alist
247
248 Association-list whose key is major-mode of a raw-article-buffer, value
249 is content-header-filter.
250 @end defvar
251
252
253
254 @defun mime-viewer/default-content-header-filter
255
256 It is called when content-header-filter is not found in variable
257 @code{mime-viewer/content-header-filter-alist}.@refill
258
259 It refers @code{mime-viewer/ignored-field-regexp}.
260 @end defun
261
262
263
264 @defvar mime-viewer/ignored-field-list
265
266 List of regular expression to represent invisible fields even if
267 content-header is displayed.@refill
268
269 Variable @code{mime-viewer/ignored-field-regexp} is created from
270 it.@refill
271
272 Please use function @code{tm:add-fields} or @code{tm:delete-fields} to
273 set it.
274 @end defvar
275
276
277
278 @node content-body, content-separator, content-header, MIME display
279 @section content-body
280 @cindex content-filter
281 @cindex content-body
282
283 @strong{content-body} represents content of the part.@refill
284
285 tm-view does not display raw content body.  For example, if a content
286 has binary, it is hidden.  If a content has text/enriched, it is
287 formated.  Namely content body is hidden or formated.@refill
288
289 Function @code{mime-viewer/body-visible-p} is a judge function whether
290 content-body of a content is displayed.  If it returns @code{nil},
291 content-body is hidden.  In default, it returns non-@code{nil} when
292 content-type of a part is a member of variable
293 @code{mime-viewer/default-showing-Content-Type-list}.@refill
294
295 When content-body of a content is displayed, content-body is formated by
296 @strong{content-filter}.  Content-filter is searched from variable
297 @code{mime-viewer/content-filter-alist}.  At this time, major-mode of
298 the raw-article-buffer (@ref{raw-article-buffer}) is used as the key.
299
300 If it is not found, function
301 @code{mime-viewer/default-content-filter} is called.
302
303
304 @defvar mime-viewer/default-showing-Content-Type-list
305
306 List of content-type.  If content-type of a part is a member of this
307 variable, its body is displayed.
308 @end defvar
309
310
311
312 @defun mime-viewer/body-visible-p rcnum cinfo  &optional  ctype
313
314 Return non-@code{nil}, if content-type of a part is displayed.
315 @var{rcnum} is reversed-content-number of a part.  @var{cinfo} is
316 content-info of the message.  If you know content-type of a part, you
317 can specify it as argument @var{ctype}.
318 @end defun
319
320
321
322 @defvar mime-viewer/content-filter-alist
323
324 Association-list whose key is major-mode of a raw-article-buffer, value
325 is content-filter.
326 @end defvar
327
328
329
330 @defun mime-viewer/default-content-filter rcnum cinfo ctype params subj
331
332 It is called when content-body of a part should be displayed and
333 content-filter is not found in
334 @code{mime-viewer/content-filter-alist}.@refill
335
336 In default, it does nothing.
337 @end defun
338
339
340
341 @node content-separator,  , content-body, MIME display
342 @section content-separator
343 @cindex content-separator
344
345 @strong{content-separator} is displayed to represent boundary of
346 contents.@refill
347
348 Content-separator is displayed by function
349 @code{mime-viewer/default-content-separator}.  In default, it displays
350 line-break when content-header and content-body are not
351 displayed.@refill
352
353 If you want to change this condition, please redefine this function.
354
355
356 @defun mime-viewer/default-content-separator rcnum cinfo ctype params subj
357
358 Display content-separator.  @var{cnum} is content-number of a content.
359 @var{cinfo} is content-info of the message.  @var{ctype} is content-type
360 of a content.  @var{params} is Content-Type field parameters of a
361 content.  @var{subj} is subject.@refill
362
363 In default, it displays line-break when content-header and content-body
364 are not displayed.
365 @end defun
366
367
368
369 @node mime/viewer-mode, method, MIME display, Top
370 @chapter Navigation in mime/viewer-mode
371
372 @code{mime/viewer-mode} has following functions:@refill
373
374 @table @kbd
375 @item @key{u}
376 goes to the upper content (returns to the Summary mode if the cursor
377 is sitting on the top content (*1))
378
379 @item @key{p}
380 goes to the previous content
381
382 @item @key{M-TAB}
383 goes to the previous content
384
385 @item @key{n}
386 goes to the next content
387
388 @item @key{TAB}
389 goes to the next content
390
391 @item @key{SPC}
392 scrolls up
393
394 @item @key{M-SPC}
395 scrolls down
396
397 @item @key{DEL}
398 scrolls down
399
400 @item @key{RET}
401 goes to the next line
402
403 @item @key{M-RET}
404 goes to the previous line
405
406 @item @key{<}
407 goes to the beginning of message
408
409 @item @key{>}
410 goes to the end of message
411
412 @item @key{v}
413 playbacks a part (*2)
414
415 @item @key{e}
416 extracts a file from a part (*2)
417
418 @item @key{C-c C-p}
419 prints a part (*2)
420
421 @item @key{f}
422 displays X-Face in the message
423
424 @item @key{mouse-button-2}
425 drives mouse button in preview-buffer.
426
427 For content-button, it playbacks a part (*2)@refill
428
429 For URL-button, it drives WWW browser@refill
430
431 @end table
432
433 @noindent
434 @strong{[Notice]}
435 @quotation
436
437 (*1) Not return to the Summary mode unless tm-view has been setup using
438 tm-mh-e, tm-vm, gnus-mime, tm-gnus, tm-rmail etc.@refill
439
440 (*2) Actual playback/extract/print will be performed by a method.
441 @end quotation
442
443
444
445 @node method, Two buffers for an article, mime/viewer-mode, Top
446 @chapter Mechanism of decoding
447 @cindex external method
448 @cindex internal method
449 @cindex method
450 @cindex decoding-mode
451 @cindex decoding operation(s) (for a part)
452
453 In @code{mime/viewer-mode}, you can do play (@kbd{v}), extract
454 (@kbd{e}), or print (@kbd{C-c C-p}) for each parts.  These operations
455 are called @strong{decoding operation(s) (for a part)}.  And kind of
456 decoding operations are called @strong{decoding-mode}.@refill
457
458 When decoding operation is driven, tm-view calls a procedure matched for
459 the condition, such as content-type (@ref{(tm-en)content-type}) of the
460 part or its environment.  This procedure is called
461 @strong{method}.@refill
462
463 There are two kinds of methods.  One is Emacs Lisp function, called
464 @strong{internal method}.  Another one is external program, called
465 @strong{external method}.@refill
466
467 Internal method operates in Emacs, so it can do carefully.@refill
468
469 External method is called as asynchronous process, so Emacs does not
470 wait while method is running.  So it is good for big data, such as
471 audio, image or video.
472
473
474 @menu
475 * decoding-condition::          Setting decoding condition for parts
476 * environment variables::       Environment variables
477 @end menu
478
479 @node decoding-condition, environment variables, method, method
480 @section Setting decoding condition for parts
481
482 When decoding operation is driven, tm-view calls a method matched for
483 the condition searched from the variable
484 @code{mime/content-decoding-condition}.@refill
485
486 Variable @code{mime/content-decoding-condition} is defined as a list
487 with the following syntax:@refill
488
489 @lisp
490         (condition_1 condition_2 ...)
491 @end lisp
492
493 Each condition are association-list with the following syntax:@refill
494
495 @lisp
496         ((field-type_1 . value_1)
497          (field-type_2 . value_2)
498          ...)
499 @end lisp
500
501 For example, if you want to call the external method named tm-plain to
502 decode every text/plain (@ref{(tm-en)text/plain}) type parts, you can
503 define the condition like:@refill
504
505 @lisp
506         ((type . "text/plain")
507          (method "tm-plain" nil 'file 'type 'encoding 'mode 'name))
508 @end lisp
509
510 This condition definition will match all parts whose content-type
511 (@ref{(tm-en)content-type}) are text/plain.  Here is an another
512 example:@refill
513
514 @lisp
515         ((type . "text/plain")
516          (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)
517          (mode . "play"))
518 @end lisp
519
520 This will match the part whose type is text/plain and the mode is
521 play.@refill
522
523 Here is an another example:@refill
524
525 @lisp
526         ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)
527          (mode . "play"))
528 @end lisp
529
530 This will match all parts which have a mode of play.@refill
531
532 The conditions defined in a variable
533 @code{mime/content-decoding-condition} are examined from top to
534 bottom.  The first matching condition becomes valid and the method
535 specified in that condition definition will be executed.
536
537
538 @menu
539 * method value::                Format of method value
540 * Example of decoding-condition::  
541 @end menu
542
543 @node method value, Example of decoding-condition, decoding-condition, decoding-condition
544 @subsection Format of method value
545
546 You can specify the method field of the decoding-condition definition in
547 two different ways,@refill
548
549 @lisp
550         (method . SYMBOL)
551 @end lisp
552
553 @noindent
554 or
555
556 @lisp
557         (method  STRING  FLAG  arg1  arg2  ...)
558 @end lisp
559
560 @noindent
561 can be accepted.
562
563 When a symbol is specified in the method field, a function whose name is
564 SYMBOL will be called as an internal method.@refill
565
566 When a list is specified in the method field, it will be called as an
567 external method.@refill
568
569 The list below shows the meaning of the parameters when the external
570 method is specified in the method field.@refill
571
572 @table @samp
573 @item STRING
574 name of an external method
575
576 @item FLAG
577 If @code{t}, both the content-header and the content-body
578 are passed to an external method.
579
580 If @code{nil}, only the content-body is passed to an external
581 method.@refill
582
583 @item ARGUMENTs
584 list of arguments passed to an external method
585
586 @end table
587
588 An argument passed to an external method can be in one of the following
589 formats:@refill
590
591 @table @samp
592 @item STRING
593 string itself
594
595 @item 'SYMBOL
596 value gotten using SYMBOL as a key from decoding-condition
597
598 @item 'STRING
599 value gotten using STRING as a key from decoding-condition
600
601 @end table
602
603 @code{'SYMBOL} can be one of the following:@refill
604
605 @table @samp
606 @item 'file
607 name of a file holding the original content
608
609 @item 'type
610 content-type/sub-type of Content-Type field
611
612 @item 'encoding
613 field body of Content-Transfer-Encoding field
614
615 @item 'mode
616 decoding-mode
617
618 @item 'name
619 name of a file created by decode operation
620
621 @end table
622
623
624 @code{'STRING} is used to search a parameter of the Content-Type
625 field whose name matches with it, and pass the value of that parameter
626 to the external method.
627
628
629 @node Example of decoding-condition,  , method value, decoding-condition
630 @subsection Example of decoding-condition
631
632 Following is an example of decoding-condition:
633
634 @lisp
635 (defvar mime/content-decoding-condition
636   '(((type . "text/plain")
637      (method "tm-plain" nil 'file 'type 'encoding 'mode 'name))
638     ((type . "text/x-latex")
639      (method "tm-latex" nil 'file 'type 'encoding 'mode 'name))
640     ((type . "audio/basic")
641      (method "tm-au"    nil 'file 'type 'encoding 'mode 'name))
642     ((type . "image/gif")
643      (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
644     ((type . "image/jpeg")
645      (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
646     ((type . "image/tiff")
647      (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
648     ((type . "image/x-tiff")
649      (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
650     ((type . "image/x-xbm")
651      (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
652     ((type . "image/x-pic")
653      (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
654     ((type . "video/mpeg")`
655      (method "tm-mpeg"  nil 'file 'type 'encoding 'mode 'name))
656     ((type . "application/octet-stream")
657      (method "tm-file"  nil 'file 'type 'encoding 'mode 'name))
658     ((type . "message/partial")
659      (method . mime/decode-message/partial-region))
660     ((method "metamail" t
661              "-m" "tm" "-x" "-d" "-z" "-e" 'file)(mode . "play"))
662     ))
663 @end lisp
664
665
666 For example, if you want to use metamail to decode any contents,
667
668 @lisp
669 (setq mime/content-decoding-condition
670       '(
671         ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file))
672        ))
673 @end lisp
674
675 @noindent
676 will work.
677
678 Variable @code{mime/content-decoding-condition} provides you of very
679 flexible way to define the conditions of decoding.  It can be simple if
680 you only need the a few decoding methods, while it can be very
681 complicated if you want to use the separate decoding method for each
682 type/mode combination.@refill
683
684 Following function may be useful to set decoding-condition.  It is a
685 function of @file{tl-atype.el}.
686
687
688 @defun set-atype symbol alist
689
690 Add condition @var{alist} to @var{symbol}.
691
692 @noindent
693 @strong{[Example]}
694 @quotation
695
696 @lisp
697 (set-atype 'mime/content-decoding-condition
698            '((type . "message/external-body")
699              ("access-type" . "anon-ftp")
700              (method . mime/decode-message/external-ftp)
701              ))
702 @end lisp
703 @end quotation
704 @end defun
705
706
707
708 @node environment variables,  , decoding-condition, method
709 @section Environment variables
710
711 Standard methods of tm-view reference some environment variables.  You
712 can specify them to customize.
713
714 @table @var
715 @item TM_TMP_DIR
716 Directory for temporary files or extracted files.  If it is omitted,
717 @file{/tmp/} is used.
718
719 @item VIDEO_DITHER
720 Dither for mpeg_play.  If it is omitted, `gray' is used.
721
722 @item TM_WWW_BROWSER
723 WWW browser name.  If it is omitted, `netscape' is used.
724
725 @end table
726
727
728
729 @node Two buffers for an article, API, method, Top
730 @chapter raw-article-buffer and preview-buffer
731 @cindex filter
732 @cindex content-filter
733 @cindex header-filter
734 @cindex preview-buffer
735 @cindex raw-article-buffer
736
737 tm-view managements two buffers, one is for raw message called
738 @strong{raw-article-buffer}, another one is to preview for user called
739 @strong{preview-buffer}.  major-mode of raw-article-buffer is same as
740 major-mode for article of original MUA, major-mode of preview-buffer is
741 @code{mime/viewer-mode} (@ref{mime/viewer-mode}).@refill
742
743 When called @code{mime/viewer-mode}, tm-view analyzes
744 raw-article-buffer, and sets its result to the variable
745 @code{mime::article/content-info}.@refill
746
747 After that, tm-view create a preview-buffer corresponded to the
748 raw-article-buffer.  As this time, tm-view modifies header and body of
749 each parts of the message by specified conditions.  Filter program for
750 header is called @strong{header-filter} (@ref{content-header}), filter
751 program for body is called @strong{content-filter} (@ref{content-body}),
752 and they are called @strong{filter}.@refill
753
754 When preview-buffer is made, buffer local variable of preview-buffer
755 @code{mime::preview/content-list} is made to register structure of
756 preview-buffer.  tm-view manages message by
757 @code{mime::article/content-info} in raw-article-buffer and
758 @code{mime::preview/content-list} in preview-buffer.@refill
759
760 @noindent
761 @strong{[Notice]}
762 @quotation
763 In this document, I call ``content-type'' as content-type/subtype of
764 Content-Type field.
765 @end quotation
766
767
768
769 @menu
770 * raw-article-buffer::          buffer local variables of raw-article-buffer
771 * preview-buffer::              Buffer local variables of preview-buffer
772 @end menu
773
774 @node raw-article-buffer, preview-buffer, Two buffers for an article, Two buffers for an article
775 @section buffer local variables of raw-article-buffer
776 @cindex content-info
777
778 @deffn{Structure} mime::content-info rcnum point-min point-max type parameters encoding children
779
780 structure to represent MIME content in raw-article-buffer.  It is called
781 by @strong{content-info}.@refill
782
783 Please use reference function @code{mime::content-info/SLOT-NAME} to
784 reference slot of content-info.  Their argument is only
785 content-info.@refill
786
787 Following is a list of slots of the structure:
788
789 @table @var
790 @item rcnum
791 ``reversed content-number'' (list)
792
793 @item point-min
794 beginning point of region in raw-article-buffer
795
796 @item point-max
797 end point of region in raw-article-buffer
798
799 @item type
800 content-type/sub-type (string or nil)
801
802 @item parameters
803 parameter of Content-Type field (association list)
804
805 @item encoding
806 Content-Transfer-Encoding (string or nil)
807
808 @item children
809 parts included in this part (list of content-infos)
810
811 @end table
812
813 If a part includes other parts in its contents, such as multipart or
814 message/rfc822, content-infos of other parts are included in
815 @var{children}, so content-info become a tree.
816 @end deffn
817
818
819 @defvar mime::article/content-info
820
821 result of MIME parsing of raw-article-buffer (content-info)
822 @end defvar
823
824
825 @defvar mime::article/preview-buffer
826
827 preview-buffer corresponded by this buffer
828 @end defvar
829
830
831 @defun mime-article/point-content-number point  &optional  cinfo
832
833 In a region managed by content-info @var{cinfo}, it returns
834 content-number corresponded by @var{point}.@refill
835
836 If @var{cinfo} is omitted, @code{mime::article/content-info} is used as
837 default value.
838 @end defun
839
840
841 @defun mime-article/rcnum-to-cinfo rcnum  &optional  cinfo
842
843 In a region managed by content-info @var{cinfo}, it returns content-info
844 corresponded by reversed-content-number @var{rcnum}.@refill
845
846 If @var{cinfo} is omitted, @code{mime::article/content-info} is used as
847 default value.
848 @end defun
849
850
851 @defun mime-article/cnum-to-cinfo rcnum  &optional  cinfo
852
853 In a region managed by content-info @var{cinfo}, it returns content-info
854 corresponded by content-number @var{rcnum}.@refill
855
856 If @var{cinfo} is omitted, @code{mime::article/content-info} is used as
857 default value.
858 @end defun
859
860
861 @defun mime/flatten-content-info  &optional  cinfo
862
863 It returns flatten list of content-info from content-info @var{cinfo}
864 tree.@refill
865
866 If @var{cinfo} is omitted, @code{mime::article/content-info} is used as
867 default value.
868 @end defun
869
870
871
872 @node preview-buffer,  , raw-article-buffer, Two buffers for an article
873 @section Buffer local variables of preview-buffer
874 @cindex preview-content-info
875
876 @defvar mime::preview/mother-buffer
877
878 Mother buffer of this preview-buffer.
879 @end defvar
880
881
882 @deffn{Structure} mime::preview-content-info point-min point-max buffer content-info
883
884 structure to represent MIME content in preview-buffer.  It is called by
885 @strong{preview-content-info}.@refill
886
887 Please use reference function
888 @code{mime::preview-content-info/SLOT-NAME} to reference slot of
889 preview-content-info.  Their argument is only
890 preview-content-info.@refill
891
892 Following is a list of slots of the structure:
893
894 @table @var
895 @item point-min
896 beginning point of region in preview-buffer
897
898 @item  point-max
899 end point of region in preview-buffer
900
901 @item buffer
902 raw-article-buffer corresponding a part
903
904 @item content-info
905 content-info corresponding a part
906
907 @end table
908 @end deffn
909
910
911
912 @defvar mime::preview/content-list
913
914 List of preview-content-info to represent structure of this
915 preview-buffer.
916 @end defvar
917
918
919
920 @defvar mime::preview/article-buffer
921
922 raw-article-buffer corresponded by this preview-buffer.
923 @end defvar
924
925
926
927 @defvar mime::preview/original-major-mode
928
929 major-mode of original buffer.
930 @end defvar
931
932
933
934 @defvar mime::preview/original-window-configuration
935
936 window-configuration just before made this preview-buffer.
937 @end defvar
938
939
940
941 @defun mime-preview/point-pcinfo point  &optional  pcl
942
943 In a region of preview-buffer managed by preview-content-info @var{pcl},
944 it returns preview-content-info corresponded by @var{point}.@refill
945
946 If @var{cinfo} is omitted, @code{mime::preview/content-list} is used.
947 @end defun
948
949
950
951 @node API, Acknowledgments, Two buffers for an article, Top
952 @chapter Functions to decode MIME message
953
954 tm-view provides some available functions to decode and navigate MIME
955 message to each MUA (@ref{(tm-en)MUA})s.@refill
956
957 There are 2 kinds of functions, one is for MIME preview, another one is
958 to decode RFC 1522 encoded-word (@ref{(tm-en)encoded-word}).
959
960
961 @menu
962 * API about MIME preview::      Function to preview MIME message
963 * encoded-word decoding::       encoded-word decoder
964 @end menu
965
966 @node API about MIME preview, encoded-word decoding, API, API
967 @section Function to preview MIME message
968
969
970 @deffn{Command} mime/viewer-mode &optional  mother ctl encoding ibuf obuf mother-keymap
971
972 Parse @var{ibuf} as a MIME message, and create preview-buffer into
973 @var{obuf} to display to user, then enter @code{mime/viewer-mode}
974 (@ref{mime/viewer-mode}).@refill
975
976 If @var{ibuf} is omitted, current buffer is used.@refill
977
978 @var{mother} is used to specify original raw-article-buffer.  It may be
979 useful when a raw-article-buffer is assembled from message/partial
980 messages.@refill
981
982 @var{ctl} is used to specify Content-Type field
983 (@ref{(tm-en)Content-Type field}) information.  Its format is output
984 format of @code{mime/Content-Type}.  When @var{ctl} is specified,
985 tm-view uses it instead of Content-Type field of the
986 raw-article-buffer.@refill
987
988 @var{encoding} is used to specify field-body of
989 Content-Transfer-Encoding field.  When is is specified, tm-view uses it
990 instead of Content-Type field of the raw-article-buffer.@refill
991
992 If @var{mother-keymap} is specified, keymap of @code{mime/viewer-mode}
993 includes it.
994 @end deffn
995
996
997
998 @node encoded-word decoding,  , API about MIME preview, API
999 @section encoded-word decoder
1000
1001 tm-view has functions to decode RFC 1522 encoded-word
1002 (@ref{(tm-en)encoded-word}).
1003
1004
1005 @deffn{Command} mime/decode-message-header
1006
1007 It decodes encoded-words in message header of current buffer.@refill
1008
1009 If an encoded-word is broken or invalid, or it has non supported MIME
1010 charset (@ref{(tm-en)MIME charset}), it is not decoded.
1011 @end deffn
1012
1013
1014
1015 @deffn{Command} mime-eword/decode-region start end  &optional  unfolding must-unfold
1016
1017 It decodes encoded-words in region @var{start} to @var{end}.@refill
1018
1019 If an encoded-word is broken or invalid, or it has non supported MIME
1020 charset (@ref{(tm-en)MIME charset}), it is not decoded.@refill
1021
1022 If @var{unfolding} is non-nil, it unfolds folded fields.@refill
1023
1024 If @var{must-fold} is non-nil and decoded result of an encoded-word has
1025 folding or raw CR or LF, it unfolds or delete raw CR or LF.
1026 @end deffn
1027
1028
1029
1030 @defun mime-eword/decode-string string  &optional  must-unfold
1031
1032 It decodes encoded-words in @var{string} and returns decoded
1033 string.@refill
1034
1035 If an encoded-word is broken or invalid, or it has non supported MIME
1036 charset (@ref{(tm-en)MIME charset}), it is not decoded.@refill
1037
1038 If @var{string} is folded, it unfolds @var{string} before
1039 decoding.@refill
1040
1041 If @var{must-fold} is non-nil and decoded result of an encoded-word has
1042 folding or raw CR or LF, it unfolds or delete raw CR or LF.
1043 @end defun
1044
1045
1046
1047 @node Acknowledgments, Concept Index, API, Top
1048 @chapter Acknowledgments
1049
1050 First of all, I thank MASUTANI Yasuhiro.  He requested me a lot of
1051 important features and gave me a lot of suggestions when tm-view was
1052 born.  tm-view is based on his influence.@refill
1053
1054 I thank ENAMI Tsugutomo for work of @file{mime.el}, which is an origin
1055 of @file{tm-ew-d.el} and @file{mel-b.el}, and permission to rewrite for
1056 tm.@refill
1057
1058 I thank OKABE Yasuo for work of internal method for LaTeX and automatic
1059 assembling method for message/partial.  I thank UENO Hiroshi for work of
1060 internal method for tar archive.@refill
1061
1062 Last of all, I thank members of two tm mailing lists, Japanese and
1063 English version.
1064
1065
1066 @node Concept Index, Function Index, Acknowledgments, Top
1067 @chapter Concept Index
1068
1069 @printindex cp
1070
1071 @node Function Index, Variable Index, Concept Index, Top
1072 @chapter Function Index
1073
1074 @printindex fn
1075
1076 @node Variable Index,  , Function Index, Top
1077 @chapter Variable Index
1078
1079 @printindex vr
1080 @bye