$Id: tm-view=en.texi,v 7.9 1996/02/28 14:35:11 morioka Exp $

tm-view
*******

The tm-view is a general MIME viewer running on GNU Emacs.

tm-view provides the major-mode called mime/viewer-mode to read MIME message for MUA. MUA implementer can use it to add MIME function.

tm-view is a user interface kernel to view and navigate MIME message. tm-view drives some programs to navigate each content-type/sub-types, they are called method. tm-view calls some programs to display each content-type/sub-types in preview buffer, they are called filter. method and filter are tm-view application program. They expand tm-view to treat various kinds of MIME types.

mime/viewer-mode
================

mime/viewer-mode is a major-mode to preview MIME message. In MIME viewer mode, you can navigate MIME message interactively.

Screen design of preview buffer
-------------------------------

In preview buffer, following are displayed for each content:

     	[content-subject]
     	(content-header)

     	(content-body)
     	(content-separator)

You can change design or stop to display if you specify for each content-types.

Example:

     From: morioka@jaist.ac.jp (MORIOKA Tomohiko)
     Subject: Re: Question
     Newsgroups: zxr.message.mime
     Date: 22 Oct 93 11:02:44
     Mime-Version: 1.0
     Organization: Japan Advanced Institute of Science and Technology,
             Ishikawa, Japan

     [1  (text/plain)]
       How to compose MIME message in MIME-Edit mode.

       Press `C-c C-x ?' then help message will be displayed:

     C-c C-x C-t	insert a text message.
     C-c C-x TAB	insert a (binary) file.
     C-c C-x C-e	insert a reference to external body.
     C-c C-x C-v	insert a voice message.
     C-c C-x C-y	insert a mail or news message.
     C-c C-x RET	insert a mail message.
     C-c C-x C-s	insert a signature file at end.
     C-c C-x t	insert a new MIME tag.
     C-c C-x a	enclose as multipart/alternative.
     C-c C-x p	enclose as multipart/parallel.
     C-c C-x m	enclose as multipart/mixed.
     C-c C-x d	enclose as multipart/digest.
     C-c C-x s	enclose as PGP signed.
     C-c C-x e	enclose as PGP encrypted.
     C-c C-x C-k	insert PGP public key.
     C-c C-x C-p	preview editing MIME message.
     ...

     So press `C-c C-x C-i' and specify file name you want to include.

       MIME encoding for binary file is normally Base64.

     [2  (image/gif)]

     [3  (text/plain)]

       In this way, it is finish a message attaching a picture.

     ======================== A cup of Russian tea ========================
     ============  * not by jam, not by marmalade, by honey *  ============
     ============               MORIOKA Tomohiko               ============
     =============== Internet E-mail: <morioka@jaist.ac.jp> ===============

     [file tm-view-cs=en.texi not included]
     [file tm-view-ch=en.texi not included]
     [file tm-view-cb=en.texi not included]

content-separator
.................

Content-separator is displayed to represent boundary of contents.

Content-separator is displayed by function mime-viewer/default-content-separator. In default, it displays line-break when content-header and content-body are not displayed.

If you want to change this condition, please redefine this function.

Function mime-viewer/default-content-separator cnum cinfo ctype params subj

Display content-separator. CNUM is content-number of a content. CINFO is content-info of the message. CTYPE is content-type of a content. PARAMS is Content-Type field parameters of a content. SUBJ is subject.

In default, it displays line-break when content-header and content-body are not displayed.

Commands of mime/viewer-mode
----------------------------

mime/viewer-mode has following functions:

u
     goes to the upper content (returns to the Summary mode if the cursor is sitting on the top content (*1))

p
     goes to the previous content

n
     goes to the next content

SPC
     scrolls up

M-SPC
     scrolls down

DEL
     scrolls down

RET
     goes to the next line

M-RET
     goes to the previous line

<
     goes to the beginning of message

>
     goes to the end of message

v
     playbacks a content            (*2)

e
     extracts a file from a content (*2)

C-c C-p
     prints a content               (*2)

f
     displays X-Face in the message

mouse-button-2
     drives mouse button.

     If you press content-subject, it playbacks the content. (*2)

     If you press URL-button, it runs WWW browser.

[Notice]

 1. Not return to the Summary mode unless tm-view has been setup using tm-mh-e, tm-gnus, tm-rmail etc.

 2. Actual playback/extract/print will be performed by a method.

     [file tm-view-m=en.texi not included]

Mechanism of tm-view
====================

tm-view managements two buffers, one is for raw message called article buffer, another one is to preview for user called preview buffer.

When called mime/viewer-mode, tm-view analyzes article buffer, and sets its result to the variable mime::article/content-info.

After that, tm-view create a preview buffer corresponded to the article buffer. As this time, tm-view modifies header and body of each contents of the message. It is done by definition for Content-Types.

On the preview buffer created by tm-view, user can manipulate a message to decode, such as run external viewer, extract files, or print.

Notice: In this document, I call content-type as content-type/subtype of Content-Type field.

     [file tm-view-a=en.texi not included]

     [file tm-view-p=en.texi not included]

Functions of tm-view
====================

tm-view provides some available functions to decode and navigate MIME message to each MUAs.

There are 2 kinds of functions, one is for MIME preview, another one is to decode RFC 1522 encoded-word.

Memo: Old tiny-mime.el was abolished. Functions to decode RFC 1522 encoded-word are took over to tm-view.

function to preview MIME message
--------------------------------

Command mime/viewer-mode &optional mother ctl encoding

Parse current-buffer as a MIME message, and create preview buffer to display to user, then enter mime/viewer-mode.

MOTHER is used to specify original article buffer. It may be useful when an article buffer is assembled from message/partial.

CTL is used to specify Content-Type field information. Its format is output format of mime/Content-Type. When CTL is specified, tm-view uses it instead of Content-Type field of the article buffer.

ENCODING is used to specify field-body of Content-Transfer-Encoding field. When is is specified, tm-view uses it instead of Content-Type field of the article buffer.

     [file tm-ew-d=en.texi not included]