tm 7.100.
[elisp/tm.git] / doc / tm-view-en.texi
1 \input texinfo.tex
2 @setfilename tm-view-en.info
3 @settitle{tm-view 7.79 Reference Manual (English Version)}
4 @titlepage
5 @title tm-view 7.79 Reference Manual (English Version)
6 @author MORIOKA Tomohiko <morioka@@jaist.ac.jp>
7 @subtitle 1996/12/25
8 @end titlepage
9 @node Top, Introduction, (dir), (dir)
10 @top tm-view 7.79 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{n}
383 goes to the next content
384
385 @item @key{SPC}
386 scrolls up
387
388 @item @key{M-SPC}
389 scrolls down
390
391 @item @key{DEL}
392 scrolls down
393
394 @item @key{RET}
395 goes to the next line
396
397 @item @key{M-RET}
398 goes to the previous line
399
400 @item @key{<}
401 goes to the beginning of message
402
403 @item @key{>}
404 goes to the end of message
405
406 @item @key{v}
407 playbacks a part (*2)
408
409 @item @key{e}
410 extracts a file from a part (*2)
411
412 @item @key{C-c C-p}
413 prints a part (*2)
414
415 @item @key{f}
416 displays X-Face in the message
417
418 @item @key{mouse-button-2}
419 drives mouse button in preview-buffer.
420
421 For content-button, it playbacks a part (*2)@refill
422
423 For URL-button, it drives WWW browser@refill
424
425 @end table
426
427 @noindent
428 @strong{[Notice]}
429 @quotation
430
431 (*1) Not return to the Summary mode unless tm-view has been setup using
432 tm-mh-e, tm-vm, gnus-mime, tm-gnus, tm-rmail etc.@refill
433
434 (*2) Actual playback/extract/print will be performed by a method.
435 @end quotation
436
437
438
439 @node method, Two buffers for an article, mime/viewer-mode, Top
440 @chapter Mechanism of decoding
441 @cindex external method
442 @cindex internal method
443 @cindex method
444 @cindex decoding-mode
445 @cindex decoding operation(s) (for a part)
446
447 In @code{mime/viewer-mode}, you can do play (@kbd{v}), extract
448 (@kbd{e}), or print (@kbd{C-c C-p}) for each parts.  These operations
449 are called @strong{decoding operation(s) (for a part)}.  And kind of
450 decoding operations are called @strong{decoding-mode}.@refill
451
452 When decoding operation is driven, tm-view calls a procedure matched for
453 the condition, such as content-type (@ref{(tm-en)content-type}) of the
454 part or its environment.  This procedure is called
455 @strong{method}.@refill
456
457 There are two kinds of methods.  One is Emacs Lisp function, called
458 @strong{internal method}.  Another one is external program, called
459 @strong{external method}.@refill
460
461 Internal method operates in Emacs, so it can do carefully.@refill
462
463 External method is called as asynchronous process, so Emacs does not
464 wait while method is running.  So it is good for big data, such as
465 audio, image or video.
466
467
468 @menu
469 * decoding-condition::          Setting decoding condition for parts
470 * environment variables::       Environment variables
471 @end menu
472
473 @node decoding-condition, environment variables, method, method
474 @section Setting decoding condition for parts
475
476 When decoding operation is driven, tm-view calls a method matched for
477 the condition searched from the variable
478 @code{mime/content-decoding-condition}.@refill
479
480 Variable @code{mime/content-decoding-condition} is defined as a list
481 with the following syntax:@refill
482
483 @lisp
484         (condition_1 condition_2 ...)
485 @end lisp
486
487 Each condition are association-list with the following syntax:@refill
488
489 @lisp
490         ((field-type_1 . value_1)
491          (field-type_2 . value_2)
492          ...)
493 @end lisp
494
495 For example, if you want to call the external method named tm-plain to
496 decode every text/plain (@ref{(tm-en)text/plain}) type parts, you can
497 define the condition like:@refill
498
499 @lisp
500         ((type . "text/plain")
501          (method "tm-plain" nil 'file 'type 'encoding 'mode 'name))
502 @end lisp
503
504 This condition definition will match all parts whose content-type
505 (@ref{(tm-en)content-type}) are text/plain.  Here is an another
506 example:@refill
507
508 @lisp
509         ((type . "text/plain")
510          (method "tm-plain" nil 'file 'type 'encoding 'mode 'name)
511          (mode . "play"))
512 @end lisp
513
514 This will match the part whose type is text/plain and the mode is
515 play.@refill
516
517 Here is an another example:@refill
518
519 @lisp
520         ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file)
521          (mode . "play"))
522 @end lisp
523
524 This will match all parts which have a mode of play.@refill
525
526 The conditions defined in a variable
527 @code{mime/content-decoding-condition} are examined from top to
528 bottom.  The first matching condition becomes valid and the method
529 specified in that condition definition will be executed.
530
531
532 @menu
533 * method value::                Format of method value
534 * Example of decoding-condition::  
535 @end menu
536
537 @node method value, Example of decoding-condition, decoding-condition, decoding-condition
538 @subsection Format of method value
539
540 You can specify the method field of the decoding-condition definition in
541 two different ways,@refill
542
543 @lisp
544         (method . SYMBOL)
545 @end lisp
546
547 @noindent
548 or
549
550 @lisp
551         (method  STRING  FLAG  arg1  arg2  ...)
552 @end lisp
553
554 @noindent
555 can be accepted.
556
557 When a symbol is specified in the method field, a function whose name is
558 SYMBOL will be called as an internal method.@refill
559
560 When a list is specified in the method field, it will be called as an
561 external method.@refill
562
563 The list below shows the meaning of the parameters when the external
564 method is specified in the method field.@refill
565
566 @table @samp
567 @item STRING
568 name of an external method
569
570 @item FLAG
571 If @code{t}, both the content-header and the content-body
572 are passed to an external method.
573
574 If @code{nil}, only the content-body is passed to an external
575 method.@refill
576
577 @item ARGUMENTs
578 list of arguments passed to an external method
579
580 @end table
581
582 An argument passed to an external method can be in one of the following
583 formats:@refill
584
585 @table @samp
586 @item STRING
587 string itself
588
589 @item 'SYMBOL
590 value gotten using SYMBOL as a key from decoding-condition
591
592 @item 'STRING
593 value gotten using STRING as a key from decoding-condition
594
595 @end table
596
597 @code{'SYMBOL} can be one of the following:@refill
598
599 @table @samp
600 @item 'file
601 name of a file holding the original content
602
603 @item 'type
604 content-type/sub-type of Content-Type field
605
606 @item 'encoding
607 field body of Content-Transfer-Encoding field
608
609 @item 'mode
610 decoding-mode
611
612 @item 'name
613 name of a file created by decode operation
614
615 @end table
616
617
618 @code{'STRING} is used to search a parameter of the Content-Type
619 field whose name matches with it, and pass the value of that parameter
620 to the external method.
621
622
623 @node Example of decoding-condition,  , method value, decoding-condition
624 @subsection Example of decoding-condition
625
626 Following is an example of decoding-condition:
627
628 @lisp
629 (defvar mime/content-decoding-condition
630   '(((type . "text/plain")
631      (method "tm-plain" nil 'file 'type 'encoding 'mode 'name))
632     ((type . "text/x-latex")
633      (method "tm-latex" nil 'file 'type 'encoding 'mode 'name))
634     ((type . "audio/basic")
635      (method "tm-au"    nil 'file 'type 'encoding 'mode 'name))
636     ((type . "image/gif")
637      (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
638     ((type . "image/jpeg")
639      (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
640     ((type . "image/tiff")
641      (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
642     ((type . "image/x-tiff")
643      (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
644     ((type . "image/x-xbm")
645      (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
646     ((type . "image/x-pic")
647      (method "tm-image" nil 'file 'type 'encoding 'mode 'name))
648     ((type . "video/mpeg")`
649      (method "tm-mpeg"  nil 'file 'type 'encoding 'mode 'name))
650     ((type . "application/octet-stream")
651      (method "tm-file"  nil 'file 'type 'encoding 'mode 'name))
652     ((type . "message/partial")
653      (method . mime/decode-message/partial-region))
654     ((method "metamail" t
655              "-m" "tm" "-x" "-d" "-z" "-e" 'file)(mode . "play"))
656     ))
657 @end lisp
658
659
660 For example, if you want to use metamail to decode any contents,
661
662 @lisp
663 (setq mime/content-decoding-condition
664       '(
665         ((method "metamail" t "-m" "tm" "-x" "-d" "-z" "-e" 'file))
666        ))
667 @end lisp
668
669 @noindent
670 will work.
671
672 Variable @code{mime/content-decoding-condition} provides you of very
673 flexible way to define the conditions of decoding.  It can be simple if
674 you only need the a few decoding methods, while it can be very
675 complicated if you want to use the separate decoding method for each
676 type/mode combination.@refill
677
678 Following function may be useful to set decoding-condition.  It is a
679 function of @file{tl-atype.el}.
680
681
682 @defun set-atype symbol alist
683
684 Add condition @var{alist} to @var{symbol}.
685
686 @noindent
687 @strong{[Example]}
688 @quotation
689
690 @lisp
691 (set-atype 'mime/content-decoding-condition
692            '((type . "message/external-body")
693              ("access-type" . "anon-ftp")
694              (method . mime/decode-message/external-ftp)
695              ))
696 @end lisp
697 @end quotation
698 @end defun
699
700
701
702 @node environment variables,  , decoding-condition, method
703 @section Environment variables
704
705 Standard methods of tm-view reference some environment variables.  You
706 can specify them to customize.
707
708 @table @var
709 @item TM_TMP_DIR
710 Directory for temporary files or extracted files.  If it is omitted,
711 @file{/tmp/} is used.
712
713 @item VIDEO_DITHER
714 Dither for mpeg_play.  If it is omitted, `gray' is used.
715
716 @item TM_WWW_BROWSER
717 WWW browser name.  If it is omitted, `netscape' is used.
718
719 @end table
720
721
722
723 @node Two buffers for an article, API, method, Top
724 @chapter raw-article-buffer and preview-buffer
725 @cindex filter
726 @cindex content-filter
727 @cindex header-filter
728 @cindex preview-buffer
729 @cindex raw-article-buffer
730
731 tm-view managements two buffers, one is for raw message called
732 @strong{raw-article-buffer}, another one is to preview for user called
733 @strong{preview-buffer}.  major-mode of raw-article-buffer is same as
734 major-mode for article of original MUA, major-mode of preview-buffer is
735 @code{mime/viewer-mode} (@ref{mime/viewer-mode}).@refill
736
737 When called @code{mime/viewer-mode}, tm-view analyzes
738 raw-article-buffer, and sets its result to the variable
739 @code{mime::article/content-info}.@refill
740
741 After that, tm-view create a preview-buffer corresponded to the
742 raw-article-buffer.  As this time, tm-view modifies header and body of
743 each parts of the message by specified conditions.  Filter program for
744 header is called @strong{header-filter} (@ref{content-header}), filter
745 program for body is called @strong{content-filter} (@ref{content-body}),
746 and they are called @strong{filter}.@refill
747
748 When preview-buffer is made, buffer local variable of preview-buffer
749 @code{mime::preview/content-list} is made to register structure of
750 preview-buffer.  tm-view manages message by
751 @code{mime::article/content-info} in raw-article-buffer and
752 @code{mime::preview/content-list} in preview-buffer.@refill
753
754 @noindent
755 @strong{[Notice]}
756 @quotation
757 In this document, I call ``content-type'' as content-type/subtype of
758 Content-Type field.
759 @end quotation
760
761
762
763 @menu
764 * raw-article-buffer::          buffer local variables of raw-article-buffer
765 * preview-buffer::              Buffer local variables of preview-buffer
766 @end menu
767
768 @node raw-article-buffer, preview-buffer, Two buffers for an article, Two buffers for an article
769 @section buffer local variables of raw-article-buffer
770 @cindex content-info
771
772 @deffn{Structure} mime::content-info rcnum point-min point-max type parameters encoding children
773
774 structure to represent MIME content in raw-article-buffer.  It is called
775 by @strong{content-info}.@refill
776
777 Please use reference function @code{mime::content-info/SLOT-NAME} to
778 reference slot of content-info.  Their argument is only
779 content-info.@refill
780
781 Following is a list of slots of the structure:
782
783 @table @var
784 @item rcnum
785 ``reversed content-number'' (list)
786
787 @item point-min
788 beginning point of region in raw-article-buffer
789
790 @item point-max
791 end point of region in raw-article-buffer
792
793 @item type
794 content-type/sub-type (string or nil)
795
796 @item parameters
797 parameter of Content-Type field (association list)
798
799 @item encoding
800 Content-Transfer-Encoding (string or nil)
801
802 @item children
803 parts included in this part (list of content-infos)
804
805 @end table
806
807 If a part includes other parts in its contents, such as multipart or
808 message/rfc822, content-infos of other parts are included in
809 @var{children}, so content-info become a tree.
810 @end deffn
811
812
813 @defvar mime::article/content-info
814
815 result of MIME parsing of raw-article-buffer (content-info)
816 @end defvar
817
818
819 @defvar mime::article/preview-buffer
820
821 preview-buffer corresponded by this buffer
822 @end defvar
823
824
825 @defun mime-article/point-content-number point  &optional  cinfo
826
827 In a region managed by content-info @var{cinfo}, it returns
828 content-number corresponded by @var{point}.@refill
829
830 If @var{cinfo} is omitted, @code{mime::article/content-info} is used as
831 default value.
832 @end defun
833
834
835 @defun mime-article/rcnum-to-cinfo rcnum  &optional  cinfo
836
837 In a region managed by content-info @var{cinfo}, it returns content-info
838 corresponded by reversed-content-number @var{rcnum}.@refill
839
840 If @var{cinfo} is omitted, @code{mime::article/content-info} is used as
841 default value.
842 @end defun
843
844
845 @defun mime-article/cnum-to-cinfo rcnum  &optional  cinfo
846
847 In a region managed by content-info @var{cinfo}, it returns content-info
848 corresponded by content-number @var{rcnum}.@refill
849
850 If @var{cinfo} is omitted, @code{mime::article/content-info} is used as
851 default value.
852 @end defun
853
854
855 @defun mime/flatten-content-info  &optional  cinfo
856
857 It returns flatten list of content-info from content-info @var{cinfo}
858 tree.@refill
859
860 If @var{cinfo} is omitted, @code{mime::article/content-info} is used as
861 default value.
862 @end defun
863
864
865
866 @node preview-buffer,  , raw-article-buffer, Two buffers for an article
867 @section Buffer local variables of preview-buffer
868 @cindex preview-content-info
869
870 @defvar mime::preview/mother-buffer
871
872 Mother buffer of this preview-buffer.
873 @end defvar
874
875
876 @deffn{Structure} mime::preview-content-info point-min point-max buffer content-info
877
878 structure to represent MIME content in preview-buffer.  It is called by
879 @strong{preview-content-info}.@refill
880
881 Please use reference function
882 @code{mime::preview-content-info/SLOT-NAME} to reference slot of
883 preview-content-info.  Their argument is only
884 preview-content-info.@refill
885
886 Following is a list of slots of the structure:
887
888 @table @var
889 @item point-min
890 beginning point of region in preview-buffer
891
892 @item  point-max
893 end point of region in preview-buffer
894
895 @item buffer
896 raw-article-buffer corresponding a part
897
898 @item content-info
899 content-info corresponding a part
900
901 @end table
902 @end deffn
903
904
905
906 @defvar mime::preview/content-list
907
908 List of preview-content-info to represent structure of this
909 preview-buffer.
910 @end defvar
911
912
913
914 @defvar mime::preview/article-buffer
915
916 raw-article-buffer corresponded by this preview-buffer.
917 @end defvar
918
919
920
921 @defvar mime::preview/original-major-mode
922
923 major-mode of original buffer.
924 @end defvar
925
926
927
928 @defvar mime::preview/original-window-configuration
929
930 window-configuration just before made this preview-buffer.
931 @end defvar
932
933
934
935 @defun mime-preview/point-pcinfo point  &optional  pcl
936
937 In a region of preview-buffer managed by preview-content-info @var{pcl},
938 it returns preview-content-info corresponded by @var{point}.@refill
939
940 If @var{cinfo} is omitted, @code{mime::preview/content-list} is used.
941 @end defun
942
943
944
945 @node API, Acknowledgments, Two buffers for an article, Top
946 @chapter Functions to decode MIME message
947
948 tm-view provides some available functions to decode and navigate MIME
949 message to each MUA (@ref{(tm-en)MUA})s.@refill
950
951 There are 2 kinds of functions, one is for MIME preview, another one is
952 to decode RFC 1522 encoded-word (@ref{(tm-en)encoded-word}).
953
954
955 @menu
956 * API about MIME preview::      Function to preview MIME message
957 * encoded-word decoding::       encoded-word decoder
958 @end menu
959
960 @node API about MIME preview, encoded-word decoding, API, API
961 @section Function to preview MIME message
962
963
964 @deffn{Command} mime/viewer-mode &optional  mother ctl encoding ibuf obuf mother-keymap
965
966 Parse @var{ibuf} as a MIME message, and create preview-buffer into
967 @var{obuf} to display to user, then enter @code{mime/viewer-mode}
968 (@ref{mime/viewer-mode}).@refill
969
970 If @var{ibuf} is omitted, current buffer is used.@refill
971
972 @var{mother} is used to specify original raw-article-buffer.  It may be
973 useful when a raw-article-buffer is assembled from message/partial
974 messages.@refill
975
976 @var{ctl} is used to specify Content-Type field
977 (@ref{(tm-en)Content-Type field}) information.  Its format is output
978 format of @code{mime/Content-Type}.  When @var{ctl} is specified,
979 tm-view uses it instead of Content-Type field of the
980 raw-article-buffer.@refill
981
982 @var{encoding} is used to specify field-body of
983 Content-Transfer-Encoding field.  When is is specified, tm-view uses it
984 instead of Content-Type field of the raw-article-buffer.@refill
985
986 If @var{mother-keymap} is specified, keymap of @code{mime/viewer-mode}
987 includes it.
988 @end deffn
989
990
991
992 @node encoded-word decoding,  , API about MIME preview, API
993 @section encoded-word decoder
994
995 tm-view has functions to decode RFC 1522 encoded-word
996 (@ref{(tm-en)encoded-word}).
997
998
999 @deffn{Command} mime/decode-message-header
1000
1001 It decodes encoded-words in message header of current buffer.@refill
1002
1003 If an encoded-word is broken or invalid, or it has non supported MIME
1004 charset (@ref{(tm-en)MIME charset}), it is not decoded.
1005 @end deffn
1006
1007
1008
1009 @deffn{Command} mime-eword/decode-region start end  &optional  unfolding must-unfold
1010
1011 It decodes encoded-words in region @var{start} to @var{end}.@refill
1012
1013 If an encoded-word is broken or invalid, or it has non supported MIME
1014 charset (@ref{(tm-en)MIME charset}), it is not decoded.@refill
1015
1016 If @var{unfolding} is non-nil, it unfolds folded fields.@refill
1017
1018 If @var{must-fold} is non-nil and decoded result of an encoded-word has
1019 folding or raw CR or LF, it unfolds or delete raw CR or LF.
1020 @end deffn
1021
1022
1023
1024 @defun mime-eword/decode-string string  &optional  must-unfold
1025
1026 It decodes encoded-words in @var{string} and returns decoded
1027 string.@refill
1028
1029 If an encoded-word is broken or invalid, or it has non supported MIME
1030 charset (@ref{(tm-en)MIME charset}), it is not decoded.@refill
1031
1032 If @var{string} is folded, it unfolds @var{string} before
1033 decoding.@refill
1034
1035 If @var{must-fold} is non-nil and decoded result of an encoded-word has
1036 folding or raw CR or LF, it unfolds or delete raw CR or LF.
1037 @end defun
1038
1039
1040
1041 @node Acknowledgments, Concept Index, API, Top
1042 @chapter Acknowledgments
1043
1044 First of all, I thank MASUTANI Yasuhiro.  He requested me a lot of
1045 important features and gave me a lot of suggestions when tm-view was
1046 born.  tm-view is based on his influence.@refill
1047
1048 I thank ENAMI Tsugutomo for work of @file{mime.el}, which is an origin
1049 of @file{tm-ew-d.el} and @file{mel-b.el}, and permission to rewrite for
1050 tm.@refill
1051
1052 I thank OKABE Yasuo for work of internal method for LaTeX and automatic
1053 assembling method for message/partial.  I thank UENO Hiroshi for work of
1054 internal method for tar archive.@refill
1055
1056 Last of all, I thank members of two tm mailing lists, Japanese and
1057 English version.
1058
1059
1060 @node Concept Index, Function Index, Acknowledgments, Top
1061 @chapter Concept Index
1062
1063 @printindex cp
1064
1065 @node Function Index, Variable Index, Concept Index, Top
1066 @chapter Function Index
1067
1068 @printindex fn
1069
1070 @node Variable Index,  , Function Index, Top
1071 @chapter Variable Index
1072
1073 @printindex vr
1074 @bye