tm 7.95.
[elisp/tm.git] / doc / tm-edit-en.sgml
1 <!doctype sinfo system>
2 <!-- $Id: tm-edit-en.sgml,v 1.1 1996/11/29 19:09:44 morioka Exp $ -->
3 <head>
4 <title>tm-edit 7.90 Reference Manual (English Version)
5 <author>MORIOKA Tomohiko <mail>morioka@jaist.ac.jp</mail>
6 <date>1996/10/11
7
8 <toc>
9 </head>
10
11 <body>
12
13 <abstract>
14 <p>
15 This file documents tm-edit, a MIME composer for GNU Emacs.
16 </abstract>
17
18
19 <h1> What is tm-edit?
20 <node> Introduction
21 <p>
22 <concept>tm-edit</concept> is a general MIME composer for GNU Emacs.
23 <p>
24 tm-edit is based on mime.el by UMEDA Masanobu
25 <mail>umerin@mse.kyutech.ac.jp</mail>, who is famous as the author of
26 GNUS.  tm-edit expands following points from <file>mime.el</file>:
27
28 <ul>
29 <li>
30 based on RFC 1521/1522
31 <li>
32 <a file="tm-en" node="Content-Disposition">Content-Disposition
33 field</a> (RFC 1806) supports
34 <li>
35 nested <a file="tm-en" node="multipart">multi-part message</a>
36 <li>
37 <dref>PGP</dref> (PGP/MIME (RFC 2015) based on security multipart (RFC
38 1847) and application/pgp based on traditional PGP)
39 <li>
40 strength automatic specification for parameter of file type
41 </ul>
42
43 <p>
44 In <dref file="tm-en">tm-MUA</dref>, you can edit MIME message easily
45 to use tm-edit.
46
47
48 <h1> mime/editor-mode
49 <node> mime/editor-mode
50 <p>
51 <concept>mime/editor-mode</concept> is a minor mode to compose MIME
52 message.  In this mode, <concept>tag</concept> represents various
53 kinds of data, you can edit <a file="tm-en" node="multipart">multi
54 part</a> message.
55 <p>
56 There are 2 kinds of tags:
57
58 <ul>
59 <li> single-part tag
60 <li> multi-part tag
61 </ul>
62 <p>
63 single-part tag represents single part, this form is following:
64
65 <verb>
66         --[[TYPE/SUBTYPE;PARAMETERS][ENCODING]
67         OPTIONAL-FIELDS]
68 </verb>
69 <p>
70 TYPE/SUBTYPE and PARAMETERS indicates type/subtype and parameters of
71 <dref file="tm-en">Content-Type field</dref>.  TYPE/SUBTYPE is
72 required, PARAMETERS is optional.
73 <p>
74 ENCODING indicates Content-Transfer-Encoding field.  It is optional
75 too.
76 <p>
77 OPTIONAL-FIELDS is to represent another fields except Content-Type
78 field and Content-Transfer-Encoding field.
79 <p>
80 multi-part tags represent <a file="tm-en" node="multipart">multi
81 part</a>.  They consist of a pair of <concept>multi-part beginning
82 tag</concept> and <concept>multi-part ending tag</concept>.
83 <p>
84 multi-part beginning tag's form is following:
85 <p>
86 <verb>
87         --<<TYPE>>-{
88 </verb>
89 <p>
90 multi-part ending tag's form is following:
91 <p>
92 <verb>
93         --}-<<TYPE>>
94 </verb>
95 <p>
96 A region from multi-part beginning tag to multi-part ending tag is
97 called as <concept>enclosure</concept>.
98
99
100 <h1> single-part operations
101 <node> single-part operations
102 <p>
103 Operations to make single-part are following:
104
105 <kl>
106 <kt>C-c C-x C-t
107 <kd>
108 Insert single-part tag indicates text part.
109 </kd>
110 <kt>C-c C-x C-i
111 <kd>
112 Insert file as a MIME attachment.
113 </kd>
114 <kt>C-c C-x C-e
115 <kd>
116 Insert external part.
117 </kd>
118 <kt>C-c C-x C-v
119 <kd>
120 Record audio input until <kbd>C-g</kbd> is pressed, and insert as a
121 audio part. (It requires /dev/audio in default.)
122 </kd>
123 <kt>C-c C-x C-y
124 <kd>
125 Insert current (mail or news) message. (It is MUA depended.)
126 </kd>
127 <kt>C-c C-x C-m
128 <kd>
129 Insert mail message. (It is MUA depended.)
130 </kd>
131 <dt><key>C-c C-x C-w</key>, <key>C-c C-x C-s</key>
132 <dd>
133 Insert signature.
134 </dd>
135 <kt>C-c C-x C-k
136 <kd>
137 Insert <dref>PGP</dref> public key. (It requires Mailcrypt package.)
138 </kd>
139 <kt>C-c C-x t
140 <kd>
141 Insert any single-part tag.
142 </kd>
143 </kl>
144
145
146 <h1> enclosure operation
147 <node> enclosure operation
148 <p>
149 Operations to make enclosure are following:
150
151 <kl>
152 <kt>C-c C-x a
153 <kd>
154 Enclose specified region as multipart/alternative.
155 </kd>
156 <kt>C-c C-x p
157 <kd>
158 Enclose specified region as multipart/parallel.
159 </kd>
160 <kt>C-c C-x m
161 <kd>
162 Enclose specified region as multipart/mixed.
163 </kd>
164 <kt>C-c C-x d
165 <kd>
166 Enclose specified region as multipart/digest.
167 </kd>
168 <kt>C-c C-x s
169 <kd>
170 Digital-sign to specified region. <cf node="PGP">
171 </kd>
172 <kt>C-c C-x e
173 <kd>
174 Encrypt to specified region. <cf node="PGP">
175 <kt>C-c C-x q
176 <kd>
177 avoid to encode tags in specified region.  In other words, tags is
178 interpreted as such string.  (In current version, it may be
179 incomplete.  Maybe PGP-signature does not work for this enclosure.)
180 </kl>
181
182
183 <h1> other operations of mime/editor-mode
184 <node> other operations of mime/editor-mode
185 <p>
186 There are another operations in mime/editor-mode.
187
188 <kl>
189 <kt>C-c C-c
190 <kd>
191 Send current editing message.
192 </kd>
193 <kt>C-c C-x C-p
194 <kd>
195 Preview current editing message. (<ref file="tm-view-en"
196 node="mime/viewer-mode">)
197 </kd>
198 <kt>C-c C-x C-z
199 <kd>
200 Exit mime/editor-mode. (<key>M-x mime/edit-again</key> is available to
201 reedit.)
202 </kd>
203 <kt>C-c C-x ?
204 <kd>
205 Display help message.
206 </kd>
207 <kt>C-c C-x /
208 <kd>
209 Set current editing message to enable automatic splitting or not.
210 Form of automatic split messages is message/partial.
211 </kd>
212 <kt>C-c C-x 7
213 <kd>
214 Set <dref file="tm-en">7bit</dref> to <dref>transfer level</dref>.
215 </kd>
216 <kt>C-c C-x 8
217 <kd>
218 Set <dref file="tm-en">8bit</dref> to <dref>transfer level</dref>.
219 </kd>
220 <kt>C-c C-x v
221 <kd>
222 Set current editing message to digital-sign or not. <cf node="PGP">
223 </kd>
224 <kt>C-c C-x h
225 <kd>
226 Set current editing message to encrypt or not. <cf node="PGP">
227 </kl>
228
229
230 <h1> transfer level
231 <node> transfer level
232 <p>
233 Contents inserted in a message are represented by <dref
234 file="tm-en">7bit</dref>, <dref file="tm-en">8bit</dref> or <dref
235 file="tm-en">binary</dref>.
236 <p>
237 If a message is translated by 7bit-through <dref
238 file="tm-en">MTA</dref>, there is no need to encode 7bit data, but
239 8bit and binary data must be encoded to 7bit data.
240 <p>
241 Similarly, if a message is translated by 8bit-through MTA, there is no
242 need to encode 7bit or 8bit data, but binary data must be encoded to
243 7bit or 8bit data.
244 <p>
245 <memo>
246 EBCDIC MTA breaks 7bit data, so in this case, 7bit data must be
247 encoded by base64.  But I don't know EBCDIC. (^_^;
248 <p>
249 Similarly, I wish ASCII-printable only MTA and code-conversion MTA
250 disappeared. (^_^;
251 <p>
252 Maybe there are binary-through MTA, but I think it is not major.
253 </memo>
254 <p>
255 <concept>transfer level</concept> represents how range data is
256 available.  tm-edit has a variable
257 <code>mime-editor/transfer-level</code> to represent transfer level.
258
259
260 <defvar name="mime-editor/transfer-level">
261 <p>
262 transfer level.
263 <p>
264 If transfer level of a data is over it, a data is encoded to 7bit.
265 <p>
266 Currently, 7 or 8 is available.  Default value is 7.
267 <p>
268 In extension plan, EBCDIC will be 5, ASCII printable only will be 6,
269 binary will be 9.  But it will not be implemented.
270 </defvar>
271
272
273 <memo>
274 transfer level is only for body, not for <a node="header">header</a>.
275 RFC 1521 extends <dref file="tm-en">RFC 822</dref> to use 8bit data in
276 body, but it requires to use <dref file="tm-en">us-ascii</dref> in
277 header.
278 </memo>
279
280
281 <h1> Using non-ASCII characters in header
282 <node> header
283 <p>
284 <dref file="tm-en">RFC 1522</dref> defines representation of non-ASCII
285 characters in header.
286 <p>
287 It is a format called as <a file="tm-en"
288 node="encoded-word"><concept>encoded-word</concept></a>, it is
289 available to represent every non-ASCII characters by <dref
290 file="tm-en">7bit</dref> to declare <dref file="tm-en">MIME
291 charset</dref>.
292
293
294 <h2> If you can not allow encoded-word
295 <node> evil setting in header
296 <p>
297 It is wrong to use ``raw'' non-ASCII characters in header not to use
298 encoded-word.  Because there are various kinds of <a file="tm-en"
299 node="Coded character set">coded character set</a> in the Internet, so
300 we can not distinguish them if <dref file="tm-en">MIME charset</dref>
301 is not declared.
302 <p>
303 For example, we can not distinguish <dref
304 file="tm-en">iso-8859-1</dref> and <dref
305 file="tm-en">iso-8859-2</dref> if MIME charset is not declared.
306 <p>
307 However you can not permit to use encoded-word, please set to
308 following variables:
309
310
311 <defvar name="mime/field-encoding-method-alist">
312 <p>
313 Association-list to specify field encoding method.  Its key is
314 field-name, value is encoding method.
315 <p>
316 field-name allows string or <code>t</code> meaning any fields.
317 <p>
318 Encoding method allows following: <code>nil</code> means
319 no-conversion, <code>mime</code> means to convert as encoded-word,
320 symbol represent MIME charset means to convert as the coded character
321 set instead of to convert as encoded-word.
322 <p>
323 field-name is searched from string.  If it is not found,
324 <code>t</code> is used.
325 <p>
326 Default value of <code>mime/field-encoding-method-alist</code> is
327 following:
328
329 <lisp>
330 (("X-Nsubject" . iso-2022-jp-2)
331  ("Newsgroups" . nil)
332  (t            . mime)
333  ))
334 </lisp>
335 </defvar>
336
337 <p>
338 In addition, if you want to specify by coded character set instead of
339 field, please use <code>mime-eword/charset-encoding-alist</code>.
340 <cf node="API about header">
341
342
343 <h2> Functions and variables about header
344 <node> API about header
345 <p>
346 <define type="Command" name="mime/encode-message-header">
347 <opts> code-conversion
348 <p>
349 It translate non-ASCII characters in message header of current buffer
350 into network representation, such as encoded-words.
351 <p>
352 If <var>code-conversion</var> is non-<code>nil</code>, field not
353 encoded by encoded-word is converted by
354 <code>mime/field-encoding-method-alist</code>.
355 </define>
356
357 <defun name="mime/encode-field">
358 <args> string
359 <p>
360 It encodes <var>string</var> into encoded-words as a field.
361 <p>
362 Long lines are folded.
363 </defun>
364
365 <defun name="mime-eword/encode-string">
366 <args> string <opts> column mode
367 <p>
368 It encodes <var>string</var> into encoded-words.
369 <p>
370 Long lines are folded.
371 <p>
372 <var>column</var> specifies start column.  If it is omitted, 0 is
373 used.
374 <p>
375 <var>mode</var> specifies where <var>string</var> is in.  Available
376 values are <code>text</code>, <code>comment</code>,
377 <code>phrase</code>.  If it is omitted, <code>phrase</code> is used.
378 </defun>
379
380 <defvar name="mime-eword/charset-encoding-alist">
381 <p>
382 Association-list of symbol represent MIME charset vs. nil,
383 <code>"B"</code> or <code>"Q"</code>.
384 <p>
385 <code>nil</code> means not to encode as encoded-word.  
386 <code>"B"</code> means to use B-encoding.
387 <code>"Q"</code> means to use Q-encoding.
388 </defvar>
389
390
391 <h1> PGP
392 <node> PGP
393 <p>
394 tm-edit provides PGP encryption, signature and inserting public-key
395 features based on <a file="tm-en"
396 node="PGP/MIME"><concept>PGP/MIME</concept></a> (RFC 2015) or <a
397 file="tm-en" node="PGP-kazu"><concept>PGP-kazu</concept></a>
398 (draft-kazu-pgp-mime-00.txt).
399 <p>
400 This feature requires pgp command and <a file="mailcrypt">Mailcrypt
401 package</a>.
402 <p>
403 If you want to use this feature, please set <code>pgp-elkins</code> or
404 <code>pgp-kazu</code> to variable
405 <code>mimed-editor/signing-type</code> and variable
406 <code>mime-editor/encrypting-type</code>.
407 <p>
408 If <code>pgp-elkins</code> is specified, PGP/MIME is used.  If
409 <code>pgp-kazu</code> is specified, PGP-kazu is used.
410
411
412 <defvar name="mime-editor/signing-type">
413 <p>
414 Format of PGP signature.
415 <p>
416 It allows <code>pgp-elkins</code> or <code>pgp-kazu</code>.
417 <p>
418 Default value is <code>nil</code>.
419 </defvar>
420
421 <defvar name="mime-editor/encrypting-type">
422 <p>
423 Format of PGP encryption.
424 <p>
425 It allows <code>pgp-elkins</code> or <code>pgp-kazu</code>.
426 <p>
427 Default value is <code>nil</code>.
428 </defvar>
429
430
431 <h1> Concept Index
432 <node> Concept Index
433
434 <cindex>
435
436
437 <h1> Function Index
438 <node> Function Index
439
440 <findex>
441
442
443 <h1> Variable Index
444 <node> Variable Index
445
446 <vindex>
447
448 </body>