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