annotate man/emacs-mime.texi @ 48958:6b4f6412de76

(custom-save-faces): Fix typo.
author Markus Rost <rost@math.uni-bielefeld.de>
date Wed, 25 Dec 2002 21:11:18 +0000
parents 0a70200bde27
children 23a1cea22d13
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32085
56bb657c0878 Add coding tag. Fix 7-bit mangling.
Dave Love <fx@gnu.org>
parents: 32008
diff changeset
1 \input texinfo @c -*-mode: texinfo; coding: latin-1 -*-
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
2
32008
a0a62e1e3675 Fix the @setfilename directive.
Eli Zaretskii <eliz@gnu.org>
parents: 31855
diff changeset
3 @setfilename ../info/emacs-mime
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
4 @settitle Emacs MIME Manual
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
5 @synindex fn cp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
6 @synindex vr cp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
7 @synindex pg cp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
8
47737
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
9 @copying
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
10 This file documents the Emacs MIME interface functionality.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
11
47737
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
12 Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
13
47737
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
14 @quotation
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
15 Permission is granted to copy, distribute and/or modify this document
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
16 under the terms of the GNU Free Documentation License, Version 1.1 or
32258
43e6b74b0852 Fix missing @ends.
Dave Love <fx@gnu.org>
parents: 32250
diff changeset
17 any later version published by the Free Software Foundation; with no
43e6b74b0852 Fix missing @ends.
Dave Love <fx@gnu.org>
parents: 32250
diff changeset
18 Invariant Sections, with the Front-Cover texts being ``A GNU
36152
0a6114a81c71 Minor changes.
Richard M. Stallman <rms@gnu.org>
parents: 35620
diff changeset
19 Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
20 license is included in the section entitled ``GNU Free Documentation
32248
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
21 License'' in the Emacs manual.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
22
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
23 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
24 this GNU Manual, like GNU software. Copies published by the Free
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
25 Software Foundation raise funds for GNU development.''
32248
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
26
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
27 This document is part of a collection distributed under the GNU Free
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
28 Documentation License. If you want to distribute this document
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
29 separately from the collection, you can do so by adding a copy of the
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
30 license to the document, as described in section 6 of the license.
47737
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
31 @end quotation
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
32 @end copying
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
33
47737
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
34 @dircategory Emacs
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
35 @direntry
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
36 * MIME: (emacs-mime). Emacs MIME de/composition library.
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
37 @end direntry
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
38 @iftex
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
39 @finalout
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
40 @end iftex
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
41 @setchapternewpage odd
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
42
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
43 @titlepage
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
44 @title Emacs MIME Manual
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
45
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
46 @author by Lars Magne Ingebrigtsen
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
47 @page
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
48 @vskip 0pt plus 1filll
47737
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
49 @insertcopying
0a70200bde27 use @copying instead of @ifinfo.
Karl Berry <karl@gnu.org>
parents: 47439
diff changeset
50 @end titlepage
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
51
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
52
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
53 @node Top
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
54 @top Emacs MIME
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
55
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
56 This manual documents the libraries used to compose and display
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
57 @sc{mime} messages.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
58
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
59 This is not a manual meant for users; it's a manual directed at people
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
60 who want to write functions and commands that manipulate @sc{mime}
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
61 elements.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
62
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
63 @sc{mime} is short for @dfn{Multipurpose Internet Mail Extensions}.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
64 This standard is documented in a number of RFCs; mainly RFC2045 (Format
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
65 of Internet Message Bodies), RFC2046 (Media Types), RFC2047 (Message
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
66 Header Extensions for Non-ASCII Text), RFC2048 (Registration
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
67 Procedures), RFC2049 (Conformance Criteria and Examples). It is highly
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
68 recommended that anyone who intends writing @sc{mime}-compliant software
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
69 read at least RFC2045 and RFC2047.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
70
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
71 @menu
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
72 * Interface Functions:: An abstraction over the basic functions.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
73 * Basic Functions:: Utility and basic parsing functions.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
74 * Decoding and Viewing:: A framework for decoding and viewing.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
75 * Composing:: MML; a language for describing MIME parts.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
76 * Standards:: A summary of RFCs and working documents used.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
77 * Index:: Function and variable index.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
78 @end menu
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
79
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
80
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
81 @node Interface Functions
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
82 @chapter Interface Functions
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
83 @cindex interface functions
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
84 @cindex mail-parse
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
85
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
86 The @code{mail-parse} library is an abstraction over the actual
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
87 low-level libraries that are described in the next chapter.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
88
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
89 Standards change, and so programs have to change to fit in the new
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
90 mold. For instance, RFC2045 describes a syntax for the
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
91 @code{Content-Type} header that only allows @sc{ascii} characters in the
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
92 parameter list. RFC2231 expands on RFC2045 syntax to provide a scheme
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
93 for continuation headers and non-@sc{ascii} characters.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
94
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
95 The traditional way to deal with this is just to update the library
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
96 functions to parse the new syntax. However, this is sometimes the wrong
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
97 thing to do. In some instances it may be vital to be able to understand
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
98 both the old syntax as well as the new syntax, and if there is only one
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
99 library, one must choose between the old version of the library and the
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
100 new version of the library.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
101
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
102 The Emacs MIME library takes a different tack. It defines a series of
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
103 low-level libraries (@file{rfc2047.el}, @file{rfc2231.el} and so on)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
104 that parses strictly according to the corresponding standard. However,
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
105 normal programs would not use the functions provided by these libraries
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
106 directly, but instead use the functions provided by the
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
107 @code{mail-parse} library. The functions in this library are just
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
108 aliases to the corresponding functions in the latest low-level
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
109 libraries. Using this scheme, programs get a consistent interface they
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
110 can use, and library developers are free to create write code that
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
111 handles new standards.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
112
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
113 The following functions are defined by this library:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
114
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
115 @defun mail-header-parse-content-type string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
116 Parse @var{string}, a @code{Content-Type} header, and return a
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
117 content-type list in the following format:
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
118
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
119 @lisp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
120 ("type/subtype"
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
121 (attribute1 . value1)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
122 (attribute2 . value2)
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
123 @dots{})
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
124 @end lisp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
125
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
126 Here's an example:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
127
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
128 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
129 (mail-header-parse-content-type
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
130 "image/gif; name=\"b980912.gif\"")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
131 @result{} ("image/gif" (name . "b980912.gif"))
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
132 @end example
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
133 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
134
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
135 @defun mail-header-parse-content-disposition string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
136 Parse @var{string}, a @code{Content-Disposition} header, and return a
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
137 content-type list in the format above.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
138 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
139
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
140 @defun mail-content-type-get ct attribute
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
141 @findex mail-content-type-get
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
142 Returns the value of the given @var{attribute} from the content-type
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
143 list @var{ct}.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
144
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
145 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
146 (mail-content-type-get
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
147 '("image/gif" (name . "b980912.gif")) 'name)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
148 @result{} "b980912.gif"
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
149 @end example
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
150 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
151
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
152 @defun mail-header-encode-parameter param value
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
153 Takes a parameter string @samp{@var{param}=@var{value}} and returns an
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
154 encoded version of it. This is used for parameters in headers like
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
155 @samp{Content-Type} and @samp{Content-Disposition}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
156 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
157
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
158 @defun mail-header-remove-comments string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
159 Return a comment-free version of @var{string}.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
160
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
161 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
162 (mail-header-remove-comments
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
163 "Gnus/5.070027 (Pterodactyl Gnus v0.27) (Finnish Landrace)")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
164 @result{} "Gnus/5.070027 "
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
165 @end example
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
166 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
167
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
168 @defun mail-header-remove-whitespace string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
169 Remove linear white space from @var{string}. Space inside quoted
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
170 strings and comments is preserved.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
171
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
172 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
173 (mail-header-remove-whitespace
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
174 "image/gif; name=\"Name with spaces\"")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
175 @result{} "image/gif;name=\"Name with spaces\""
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
176 @end example
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
177 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
178
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
179 @defun mail-header-get-comment string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
180 Return the last comment in @var{string}.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
181
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
182 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
183 (mail-header-get-comment
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
184 "Gnus/5.070027 (Pterodactyl Gnus v0.27) (Finnish Landrace)")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
185 @result{} "Finnish Landrace"
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
186 @end example
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
187 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
188
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
189
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
190 @defun mail-header-parse-address string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
191 Parse an address string @var{string} and return a list containing the
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
192 mailbox and the plaintext name.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
193
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
194 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
195 (mail-header-parse-address
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
196 "Hrvoje Niksic <hniksic@@srce.hr>")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
197 @result{} ("hniksic@@srce.hr" . "Hrvoje Niksic")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
198 @end example
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
199 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
200
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
201 @defun mail-header-parse-addresses string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
202 Parse @var{string} as a list of addresses and return a list of elements
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
203 like the one described above.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
204
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
205 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
206 (mail-header-parse-addresses
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
207 "Hrvoje Niksic <hniksic@@srce.hr>, Steinar Bang <sb@@metis.no>")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
208 @result{} (("hniksic@@srce.hr" . "Hrvoje Niksic")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
209 ("sb@@metis.no" . "Steinar Bang"))
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
210 @end example
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
211 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
212
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
213 @defun mail-header-parse-date string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
214 Parse a date @var{string} and return an Emacs time structure.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
215 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
216
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
217 @defun mail-narrow-to-head
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
218 Narrow the buffer to the header section of the buffer. Point is placed
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
219 at the beginning of the narrowed buffer.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
220 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
221
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
222 @defun mail-header-narrow-to-field
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
223 Narrow the buffer to the header under point.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
224 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
225
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
226 @defun mail-encode-encoded-word-region start end
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
227 Encode the non-@sc{ascii} words in the region @var{start}to @var{end}. For
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
228 instance, @samp{Naïve} is encoded as @samp{=?iso-8859-1?q?Na=EFve?=}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
229 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
230
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
231 @defun mail-encode-encoded-word-buffer
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
232 Encode the non-@sc{ascii} words in the current buffer. This function is
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
233 meant to be called with the buffer narrowed to the headers of a message.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
234 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
235
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
236 @defun mail-encode-encoded-word-string string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
237 Encode the words that need encoding in @var{string}, and return the
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
238 result.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
239
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
240 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
241 (mail-encode-encoded-word-string
32085
56bb657c0878 Add coding tag. Fix 7-bit mangling.
Dave Love <fx@gnu.org>
parents: 32008
diff changeset
242 "This is naïve, baby")
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
243 @result{} "This is =?iso-8859-1?q?na=EFve,?= baby"
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
244 @end example
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
245 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
246
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
247 @defun mail-decode-encoded-word-region start end
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
248 Decode the encoded words in the region @var{start}to @var{end}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
249 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
250
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
251 @defun mail-decode-encoded-word-string string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
252 Decode the encoded words in @var{string} and return the result.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
253
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
254 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
255 (mail-decode-encoded-word-string
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
256 "This is =?iso-8859-1?q?na=EFve,?= baby")
32085
56bb657c0878 Add coding tag. Fix 7-bit mangling.
Dave Love <fx@gnu.org>
parents: 32008
diff changeset
257 @result{} "This is naïve, baby"
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
258 @end example
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
259 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
260
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
261 Currently, @code{mail-parse} is an abstraction over @code{ietf-drums},
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
262 @code{rfc2047}, @code{rfc2045} and @code{rfc2231}. These are documented
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
263 in the subsequent sections.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
264
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
265
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
266
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
267 @node Basic Functions
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
268 @chapter Basic Functions
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
269
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
270 This chapter describes the basic, ground-level functions for parsing and
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
271 handling. Covered here is parsing @code{From} lines, removing comments
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
272 from header lines, decoding encoded words, parsing date headers and so
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
273 on. High-level functionality is dealt with in the next chapter
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
274 (@pxref{Decoding and Viewing}).
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
275
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
276 @menu
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
277 * rfc2045:: Encoding @code{Content-Type} headers.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
278 * rfc2231:: Parsing @code{Content-Type} headers.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
279 * ietf-drums:: Handling mail headers defined by RFC822bis.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
280 * rfc2047:: En/decoding encoded words in headers.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
281 * time-date:: Functions for parsing dates and manipulating time.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
282 * qp:: Quoted-Printable en/decoding.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
283 * base64:: Base64 en/decoding.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
284 * binhex:: Binhex decoding.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
285 * uudecode:: Uuencode decoding.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
286 * rfc1843:: Decoding HZ-encoded text.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
287 * mailcap:: How parts are displayed is specified by mailcap files
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
288 @end menu
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
289
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
290
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
291 @node rfc2045
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
292 @section rfc2045
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
293
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
294 RFC2045 is the ``main'' @sc{mime} document, and as such, one would
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
295 imagine that there would be a lot to implement. But there isn't, since
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
296 most of the implementation details are delegated to the subsequent
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
297 RFCs.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
298
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
299 So @file{rfc2045.el} has only a single function:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
300
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
301 @defun rfc2045-encode-string parameter value
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
302 @findex rfc2045-encode-string
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
303 Takes a @var{parameter} and a @var{value} and returns a
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
304 @samp{@var{param}=@var{value}} string. @var{value} will be quoted if
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
305 there are non-safe characters in it.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
306 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
307
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
308
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
309 @node rfc2231
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
310 @section rfc2231
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
311
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
312 RFC2231 defines a syntax for the @samp{Content-Type} and
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
313 @samp{Content-Disposition} headers. Its snappy name is @dfn{MIME
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
314 Parameter Value and Encoded Word Extensions: Character Sets, Languages,
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
315 and Continuations}.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
316
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
317 In short, these headers look something like this:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
318
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
319 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
320 Content-Type: application/x-stuff;
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
321 title*0*=us-ascii'en'This%20is%20even%20more%20;
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
322 title*1*=%2A%2A%2Afun%2A%2A%2A%20;
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
323 title*2="isn't it!"
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
324 @end example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
325
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
326 They usually aren't this bad, though.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
327
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
328 The following functions are defined by this library:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
329
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
330 @defun rfc2231-parse-string string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
331 Parse a @samp{Content-Type} header @var{string} and return a list
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
332 describing its elements.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
333
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
334 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
335 (rfc2231-parse-string
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
336 "application/x-stuff;
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
337 title*0*=us-ascii'en'This%20is%20even%20more%20;
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
338 title*1*=%2A%2A%2Afun%2A%2A%2A%20;
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
339 title*2=\"isn't it!\"")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
340 @result{} ("application/x-stuff"
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
341 (title . "This is even more ***fun*** isn't it!"))
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
342 @end example
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
343 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
344
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
345 @defun rfc2231-get-value ct attribute
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
346 Takes a list @var{ct} of the format above and returns the value of the
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
347 specified @var{attribute}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
348 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
349
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
350 @defun rfc2231-encode-string parameter value
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
351 Encode the string @samp{@var{parameter}=@var{value}} for inclusion in
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
352 headers likes @samp{Content-Type} and @samp{Content-Disposition}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
353 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
354
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
355 @node ietf-drums
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
356 @section ietf-drums
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
357
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
358 @dfn{drums} is an IETF working group that is working on the replacement
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
359 for RFC822.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
360
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
361 The functions provided by this library include:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
362
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
363 @defun ietf-drums-remove-comments string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
364 Remove the comments from @var{string} and return the result.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
365 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
366
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
367 @defun ietf-drums-remove-whitespace string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
368 Remove linear white space from @var{string} and return the result.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
369 Spaces inside quoted strings and comments are left untouched.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
370 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
371
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
372 @defun ietf-drums-get-comment string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
373 Return the last most comment from @var{string}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
374 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
375
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
376 @defun ietf-drums-parse-address string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
377 Parse an address @var{string} and return a list of the mailbox and the
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
378 plain text name.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
379 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
380
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
381 @defun ietf-drums-parse-addresses string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
382 Parse @var{string}, containing any number of comma-separated addresses,
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
383 and return a list of mailbox/plain text pairs.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
384 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
385
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
386 @defun ietf-drums-parse-date string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
387 Parse the date @var{string} and return an Emacs time structure.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
388 @end defun
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
389
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
390 @defun ietf-drums-narrow-to-header
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
391 Narrow the buffer to the header section of the current buffer.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
392 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
393
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
394
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
395 @node rfc2047
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
396 @section rfc2047
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
397
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
398 RFC2047 (Message Header Extensions for Non-ASCII Text) specifies how
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
399 non-@sc{ascii} text in headers are to be encoded. This is actually rather
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
400 complicated, so a number of variables are necessary to tweak what this
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
401 library does.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
402
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
403 The following variables are tweakable:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
404
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
405 @defvar rfc2047-default-charset
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
406 Characters in this charset should not be decoded by this library.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
407 This defaults to @samp{iso-8859-1}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
408 @end defvar
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
409
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
410 @defvar rfc2047-header-encoding-list
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
411 This is an alist of header / encoding-type pairs. Its main purpose is
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
412 to prevent encoding of certain headers.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
413 @end defvar
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
414
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
415 The keys can either be header regexps, or @code{t}.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
416
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
417 The values can be either @code{nil}, in which case the header(s) in
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
418 question won't be encoded, or @code{mime}, which means that they will be
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
419 encoded.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
420
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
421 @defvar rfc2047-charset-encoding-alist
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
422 RFC2047 specifies two forms of encoding---@code{Q} (a
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
423 Quoted-Printable-like encoding) and @code{B} (base64). This alist
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
424 specifies which charset should use which encoding.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
425 @end defvar
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
426
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
427 @defvar rfc2047-encoding-function-alist
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
428 This is an alist of encoding / function pairs. The encodings are
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
429 @code{Q}, @code{B} and @code{nil}.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
430 @end defvar
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
431
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
432 @defvar rfc2047-q-encoding-alist
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
433 The @code{Q} encoding isn't quite the same for all headers. Some
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
434 headers allow a narrower range of characters, and that is what this
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
435 variable is for. It's an alist of header regexps and allowable character
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
436 ranges.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
437 @end defvar
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
438
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
439 @defvar rfc2047-encoded-word-regexp
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
440 When decoding words, this library looks for matches to this regexp.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
441 @end defvar
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
442
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
443 Those were the variables, and these are the functions:
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
444
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
445 @defun rfc2047-narrow-to-field
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
446 Narrow the buffer to the header on the current line.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
447 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
448
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
449 @defun rfc2047-encode-message-header
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
450 Should be called narrowed to the header of a message. Encodes according
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
451 to @code{rfc2047-header-encoding-alist}.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
452 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
453
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
454 @defun rfc2047-encode-region start end
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
455 Encodes all encodable words in the region @var{start} to @var{end}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
456 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
457
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
458 @defun rfc2047-encode-string string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
459 Encode @var{string} and return the result.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
460 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
461
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
462 @defun rfc2047-decode-region start end
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
463 Decode the encoded words in the region @var{start} to @var{end}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
464 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
465
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
466 @defun rfc2047-decode-string string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
467 Decode @var{string} and return the result.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
468 @end defun
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
469
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
470
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
471
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
472 @node time-date
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
473 @section time-date
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
474
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
475 While not really a part of the @sc{mime} library, it is convenient to
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
476 document this library here. It deals with parsing @samp{Date} headers
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
477 and manipulating time. (Not by using tesseracts, though, I'm sorry to
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
478 say.)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
479
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
480 These functions convert between five formats: a date string, an Emacs
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
481 time structure, a decoded time list, a number of seconds, and a day number.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
482
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
483 The functions have quite self-explanatory names, so the following just
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
484 gives an overview of which functions are available.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
485
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
486 @findex parse-time-string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
487 @findex date-to-time
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
488 @findex time-to-seconds
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
489 @findex seconds-to-time
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
490 @findex time-to-day
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
491 @findex days-to-time
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
492 @findex time-since
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
493 @findex time-less-p
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
494 @findex subtract-time
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
495 @findex days-between
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
496 @findex date-leap-year-p
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
497 @findex time-to-day-in-year
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
498 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
499 (parse-time-string "Sat Sep 12 12:21:54 1998 +0200")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
500 @result{} (54 21 12 12 9 1998 6 nil 7200)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
501
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
502 (date-to-time "Sat Sep 12 12:21:54 1998 +0200")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
503 @result{} (13818 19266)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
504
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
505 (time-to-seconds '(13818 19266))
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
506 @result{} 905595714.0
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
507
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
508 (seconds-to-time 905595714.0)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
509 @result{} (13818 19266 0)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
510
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
511 (time-to-day '(13818 19266))
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
512 @result{} 729644
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
513
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
514 (days-to-time 729644)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
515 @result{} (961933 65536)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
516
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
517 (time-since '(13818 19266))
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
518 @result{} (0 430)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
519
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
520 (time-less-p '(13818 19266) '(13818 19145))
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
521 @result{} nil
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
522
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
523 (subtract-time '(13818 19266) '(13818 19145))
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
524 @result{} (0 121)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
525
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
526 (days-between "Sat Sep 12 12:21:54 1998 +0200"
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
527 "Sat Sep 07 12:21:54 1998 +0200")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
528 @result{} 5
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
529
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
530 (date-leap-year-p 2000)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
531 @result{} t
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
532
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
533 (time-to-day-in-year '(13818 19266))
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
534 @result{} 255
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
535 @end example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
536
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
537 @findex safe-date-to-time
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
538 And finally, we have @code{safe-date-to-time}, which does the same as
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
539 @code{date-to-time}, but returns a zero time if the date is
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
540 syntactically malformed.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
541
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
542
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
543
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
544 @node qp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
545 @section qp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
546
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
547 This library deals with decoding and encoding Quoted-Printable text.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
548
32248
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
549 Very briefly explained, QP encoding means translating all 8-bit
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
550 characters (and lots of control characters) into things that look like
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
551 @samp{=EF}; that is, an equal sign followed by the byte encoded as a hex
32248
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
552 string. It is defined in RFC 2045.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
553
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
554 The following functions are defined by the library:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
555
32248
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
556 @deffn Command quoted-printable-decode-region @var{from} @var{to} &optional @var{coding-system}
35523
8a1b48ccaa0e QP tweaks
Dave Love <fx@gnu.org>
parents: 33671
diff changeset
557 QP-decode all the encoded text in the region. If @var{coding-system}
8a1b48ccaa0e QP tweaks
Dave Love <fx@gnu.org>
parents: 33671
diff changeset
558 is non-nil, decode bytes into characters with that coding-system. It
8a1b48ccaa0e QP tweaks
Dave Love <fx@gnu.org>
parents: 33671
diff changeset
559 is probably better not to use @var{coding-system}; instead decode into
8a1b48ccaa0e QP tweaks
Dave Love <fx@gnu.org>
parents: 33671
diff changeset
560 a unibyte buffer, decode that appropriately and then interpret it as
8a1b48ccaa0e QP tweaks
Dave Love <fx@gnu.org>
parents: 33671
diff changeset
561 multibyte.
32258
43e6b74b0852 Fix missing @ends.
Dave Love <fx@gnu.org>
parents: 32250
diff changeset
562 @end deffn
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
563
32248
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
564 @defun quoted-printable-decode-string @var{string} &optional @var{coding-system}
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
565 Return a QP-encoded copy of @var{string}. If @var{coding-system} is
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
566 non-nil, decode bytes into characters with that coding-system.
32258
43e6b74b0852 Fix missing @ends.
Dave Love <fx@gnu.org>
parents: 32250
diff changeset
567 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
568
32248
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
569 @deffn Command quoted-printable-encode-region @var{from} @var{to} &optional @var{fold} @var{class}
35523
8a1b48ccaa0e QP tweaks
Dave Love <fx@gnu.org>
parents: 33671
diff changeset
570 QP-encode all the region. If @var{fold} is non-@var{nil}, fold lines
8a1b48ccaa0e QP tweaks
Dave Love <fx@gnu.org>
parents: 33671
diff changeset
571 at 76 characters, as required by the RFC. If @var{class} is
35620
654bde0f95a6 *** empty log message ***
Dave Love <fx@gnu.org>
parents: 35523
diff changeset
572 non-@code{nil}, translate the characters not matched by that regexp
654bde0f95a6 *** empty log message ***
Dave Love <fx@gnu.org>
parents: 35523
diff changeset
573 class, which should be in the form expected by
654bde0f95a6 *** empty log message ***
Dave Love <fx@gnu.org>
parents: 35523
diff changeset
574 @var{skip-chars-forward} and should probably not contain literal
654bde0f95a6 *** empty log message ***
Dave Love <fx@gnu.org>
parents: 35523
diff changeset
575 eight-bit characters. Specifying @var{class} makes sense to do extra
654bde0f95a6 *** empty log message ***
Dave Love <fx@gnu.org>
parents: 35523
diff changeset
576 encoding in header fields.
35523
8a1b48ccaa0e QP tweaks
Dave Love <fx@gnu.org>
parents: 33671
diff changeset
577
8a1b48ccaa0e QP tweaks
Dave Love <fx@gnu.org>
parents: 33671
diff changeset
578 If variable @var{mm-use-ultra-safe-encoding} is defined and
8a1b48ccaa0e QP tweaks
Dave Love <fx@gnu.org>
parents: 33671
diff changeset
579 non-@code{nil}, fold lines unconditionally and encode @samp{From } and
8a1b48ccaa0e QP tweaks
Dave Love <fx@gnu.org>
parents: 33671
diff changeset
580 @samp{-} at the start of lines..
32258
43e6b74b0852 Fix missing @ends.
Dave Love <fx@gnu.org>
parents: 32250
diff changeset
581 @end deffn
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
582
32248
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
583 @defun quoted-printable-encode-string string
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
584 Return a QP-encoded copy of @var{string}.
32258
43e6b74b0852 Fix missing @ends.
Dave Love <fx@gnu.org>
parents: 32250
diff changeset
585 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
586
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
587 @node base64
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
588 @section base64
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
589 @cindex base64
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
590
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
591 Base64 is an encoding that encodes three bytes into four characters,
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
592 thereby increasing the size by about 33%. The alphabet used for
32248
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
593 encoding is very resistant to mangling during transit. @xref{Base
086aff3bf8ca Modify licence notice. QP, base64 changes.
Dave Love <fx@gnu.org>
parents: 32085
diff changeset
594 64,,Base 64 Encoding, elisp, The Emacs Lisp Reference Manual}.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
595
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
596 @node binhex
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
597 @section binhex
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
598 @cindex binhex
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
599 @cindex Apple
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
600 @cindex Macintosh
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
601
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
602 Binhex is an encoding that originated in Macintosh environments.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
603 The following function is supplied to deal with these:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
604
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
605 @defun binhex-decode-region start end &optional header-only
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
606 Decode the encoded text in the region @var{start} to @var{end}. If
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
607 @var{header-only} is non-@code{nil}, only decode the @samp{binhex}
36152
0a6114a81c71 Minor changes.
Richard M. Stallman <rms@gnu.org>
parents: 35620
diff changeset
608 header and return the file name.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
609 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
610
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
611
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
612 @node uudecode
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
613 @section uudecode
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
614 @cindex uuencode
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
615 @cindex uudecode
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
616
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
617 Uuencoding is probably still the most popular encoding of binaries
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
618 used on Usenet, although Base64 rules the mail world.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
619
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
620 The following function is supplied by this package:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
621
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
622 @defun uudecode-decode-region start end &optional file-name
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
623 Decode the text in the region @var{start} to @var{end}. If
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
624 @var{file-name} is non-@code{nil}, save the result to @var{file-name}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
625 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
626
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
627
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
628 @node rfc1843
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
629 @section rfc1843
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
630 @cindex rfc1843
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
631 @cindex HZ
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
632 @cindex Chinese
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
633
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
634 RFC1843 deals with mixing Chinese and @sc{ascii} characters in messages. In
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
635 essence, RFC1843 switches between @sc{ascii} and Chinese by doing this:
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
636
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
637 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
638 This sentence is in ASCII.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
639 The next sentence is in GB.~@{<:Ky2;S@{#,NpJ)l6HK!#~@}Bye.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
640 @end example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
641
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
642 Simple enough, and widely used in China.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
643
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
644 The following functions are available to handle this encoding:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
645
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
646 @defun rfc1843-decode-region start end
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
647 Decode HZ-encoded text in the region @var{start} to @var{end}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
648 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
649
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
650 @defun rfc1843-decode-string string
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
651 Decode the HZ-encoded @var{string} and return the result.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
652 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
653
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
654
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
655 @node mailcap
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
656 @section mailcap
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
657
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
658 As specified by RFC 1524, @sc{mime}-aware message handlers parse
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
659 @dfn{mailcap} files from a default list, which can be overridden by the
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
660 @code{MAILCAP} environment variable. These describe how elements are
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
661 supposed to be displayed. Here's an example file:
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
662
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
663 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
664 image/*; gimp -8 %s
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
665 audio/wav; wavplayer %s
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
666 @end example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
667
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
668 This says that all image files should be displayed with @command{gimp},
39539
1f0f069f32ea * emacs-mime.texi (mailcap): rvplayer -> wavplayer. Thanks to
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 38865
diff changeset
669 and that WAVE audio files should be played by @code{wavplayer}.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
670
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
671 The @code{mailcap} library parses such files, and provides functions for
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
672 matching types.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
673
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
674 @defvar mailcap-mime-data
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
675 This variable is an alist of alists containing backup viewing rules for
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
676 @sc{mime} types. These are overridden by rules for a type found in
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
677 mailcap files. The outer alist is keyed on the major content-type and
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
678 the inner alists are keyed on the minor content-type (which can be a
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
679 regular expression).
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
680
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
681 @c Fixme: document this properly!
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
682 For example:
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
683 @example
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
684 (("application"
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
685 ("octet-stream"
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
686 (viewer . mailcap-save-binary-file)
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
687 (non-viewer . t)
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
688 (type . "application/octet-stream"))
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
689 ("plain"
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
690 (viewer . view-mode)
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
691 (test fboundp 'view-mode)
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
692 (type . "text/plain")))
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
693 @end example
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
694 @end defvar
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
695
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
696 @defopt mailcap-default-mime-data
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
697 This variable is the default value of @code{mailcap-mime-data}. It
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
698 exists to allow setting the value using Custom. It is merged with
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
699 values from mailcap files by @code{mailcap-parse-mailcaps}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
700 @end defopt
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
701
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
702 Although it is not specified by the RFC, @sc{mime} tools normally use a
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
703 common means of associating file extensions with defualt @sc{mime} types
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
704 in the absence of other information about the type of a file. The
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
705 information is found in per-user files @file{~/.mime.types} and system
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
706 @file{mime.types} files found in quasi-standard places. Here is an
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
707 example:
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
708
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
709 @example
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
710 application/x-dvi dvi
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
711 audio/mpeg mpga mpega mp2 mp3
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
712 image/jpeg jpeg jpg jpe
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
713 @end example
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
714
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
715
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
716 @defvar mailcap-mime-extensions
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
717 This variable is an alist @sc{mime} types keyed by file extensions.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
718 This is overridden by entries found in @file{mime.types} files.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
719 @end defvar
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
720
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
721 @defopt mailcap-default-mime-extensions
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
722 This variable is the default value of @code{mailcap-mime-extensions}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
723 It exists to allow setting the value using Custom. It is merged with
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
724 values from mailcap files by @code{mailcap-parse-mimetypes}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
725 @end defopt
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
726
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
727 Interface functions:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
728
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
729 @defun mailcap-parse-mailcaps &optional path force
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
730 Parse all the mailcap files specified in a path string @var{path} and
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
731 merge them with the values from @code{mailcap-mime-data}. Components of
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
732 @var{path} are separated by the @code{path-separator} character
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
733 appropriate for the system. If @var{force} is non-@code{nil}, the files
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
734 are re-parsed even if they have been parsed already. If @var{path} is
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
735 omitted, use the value of environment variable @code{MAILCAPS} if it is
38865
62e02f5ae533 Avoid saying "Unix" in a way that includes GNU.
Richard M. Stallman <rms@gnu.org>
parents: 36152
diff changeset
736 set; otherwise (on GNU and Unix) use the path defined in RFC 1524, plus
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
737 @file{/usr/local/etc/mailcap}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
738 @end defun
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
739
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
740 @defun mailcap-parse-mimetypes &optional path force
38865
62e02f5ae533 Avoid saying "Unix" in a way that includes GNU.
Richard M. Stallman <rms@gnu.org>
parents: 36152
diff changeset
741 Parse all the mimetypes specified in a path string @var{path}
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
742 and merge them with the values from @code{mailcap-mime-extensions}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
743 Components of @var{path} are separated by the @code{path-separator}
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
744 character appropriate for the system. If @var{path} is omitted, use the
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
745 value of environment variable @code{MIMETYPES} if set; otherwise use a
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
746 default path consistent with that used by @code{mailcap-parse-mailcaps}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
747 If @var{force} is non-@code{nil}, the files are re-parsed even if they
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
748 have been parsed already.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
749 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
750
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
751 @defun mailcap-mime-info string &optional request
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
752 Gets the viewer command for content-type @var{string}. @code{nil} is
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
753 returned if none is found. Expects @var{string} to be a complete
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
754 content-type header line.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
755
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
756 If @var{request} is non-@code{nil} it specifies what information to
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
757 return. If it is nil or the empty string, the viewer (second field of
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
758 the mailcap entry) will be returned. If it is a string, then the
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
759 mailcap field corresponding to that string will be returned
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
760 (@samp{print}, @samp{description}, whatever). If it is a number, all
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
761 the information for this viewer is returned. If it is @code{all}, then
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
762 all possible viewers for this type is returned.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
763 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
764
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
765 @defun mailcap-mime-types
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
766 This function returns a list of all the defined media types.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
767 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
768
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
769 @defun mailcap-extension-to-mime extension
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
770 This function returns the content type defined for a file with the given
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
771 @var{extension}.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
772 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
773
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
774
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
775 @node Decoding and Viewing
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
776 @chapter Decoding and Viewing
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
777
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
778 This chapter deals with decoding and viewing @sc{mime} messages on a
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
779 higher level.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
780
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
781 The main idea is to first analyze a @sc{mime} article, and then allow
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
782 other programs to do things based on the list of @dfn{handles} that are
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
783 returned as a result of this analysis.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
784
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
785 @menu
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
786 * Dissection:: Analyzing a @sc{mime} message.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
787 * Handles:: Handle manipulations.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
788 * Display:: Displaying handles.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
789 * Customization:: Variables that affect display.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
790 * New Viewers:: How to write your own viewers.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
791 @end menu
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
792
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
793
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
794 @node Dissection
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
795 @section Dissection
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
796
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
797 The @code{mm-dissect-buffer} is the function responsible for dissecting
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
798 a @sc{mime} article. If given a multipart message, it will recursively
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
799 descend the message, following the structure, and return a tree of
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
800 @sc{mime} handles that describes the structure of the message.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
801
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
802
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
803 @node Handles
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
804 @section Handles
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
805
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
806 A @sc{mime} handle is a list that fully describes a @sc{mime} component.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
807
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
808 The following macros can be used to access elements from the
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
809 @var{handle} argument:
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
810
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
811 @defmac mm-handle-buffer handle
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
812 Return the buffer that holds the contents of the undecoded @sc{mime}
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
813 part.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
814 @end defmac
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
815
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
816 @defmac mm-handle-type handle
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
817 Return the parsed @samp{Content-Type} of the part.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
818 @end defmac
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
819
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
820 @defmac mm-handle-encoding handle
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
821 Return the @samp{Content-Transfer-Encoding} of the part.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
822 @end defmac
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
823
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
824 @defmac mm-handle-undisplayer handle
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
825 Return the function that can be used to remove the displayed part (if it
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
826 has been displayed).
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
827 @end defmac
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
828
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
829 @defmac mm-handle-set-undisplayer handle function
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
830 Set the undisplayer function for the part to function.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
831 @end defmac
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
832
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
833 @defmac mm-handle-disposition
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
834 Return the parsed @samp{Content-Disposition} of the part.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
835 @end defmac
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
836
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
837 @defmac mm-handle-disposition
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
838 Return the description of the part.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
839 @end defmac
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
840
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
841 @defmac mm-get-content-id id
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
842 Returns the handle(s) referred to by @var{id}, the @samp{Content-ID} of
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
843 the part.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
844 @end defmac
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
845
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
846
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
847 @node Display
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
848 @section Display
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
849
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
850 Functions for displaying, removing and saving. In the descriptions
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
851 below, `the part' means the @sc{mime} part represented by the
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
852 @var{handle} argument.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
853
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
854 @defun mm-display-part handle &optional no-default
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
855 Display the part. Return @code{nil} if the part is removed,
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
856 @code{inline} if it is displayed inline or @code{external} if it is
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
857 displayed externally. If @var{no-default} is non-@code{nil}, the part
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
858 is not displayed unless the @sc{mime} type of @var{handle} is defined to
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
859 be displayed inline or there is an display method defined for it; i.e.@:
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
860 no default external method will be used.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
861 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
862
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
863 @defun mm-remove-part handle
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
864 Remove the part if it has been displayed.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
865 @end defun
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
866
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
867 @defun mm-inlinable-p handle
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
868 Return non-@code{nil} if the part can be displayed inline.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
869 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
870
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
871 @defun mm-automatic-display-p handle
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
872 Return non-@code{nil} if the user has requested automatic display of the
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
873 @sc{mime} type of the part.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
874 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
875
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
876 @defun mm-destroy-part handle
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
877 Free all the resources used by the part.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
878 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
879
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
880 @defun mm-save-part handle
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
881 Save the part to a file. The user is prompted for a file name to use.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
882 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
883
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
884 @defun mm-pipe-part handle
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
885 Pipe the part through a shell command. The user is prompted for the
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
886 command to use.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
887 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
888
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
889 @defun mm-interactively-view-part handle
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
890 Prompt for a mailcap method to use to view the part and display it
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
891 externally using that method.
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
892 @end defun
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
893
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
894
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
895 @node Customization
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
896 @section Customization
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
897
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
898 The display of @sc{mime} types may be customized with the following
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
899 options.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
900
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
901 @defopt mm-inline-media-tests
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
902 This is an alist where the key is a @sc{mime} type, the second element
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
903 is a function to display the part @dfn{inline} (i.e., inside Emacs), and
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
904 the third element is a form to be @code{eval}ed to say whether the part
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
905 can be displayed inline.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
906
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
907 This variable specifies whether a part @emph{can} be displayed inline,
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
908 and, if so, how to do it. It does not say whether parts are
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
909 @emph{actually} displayed inline.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
910 @end defopt
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
911
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
912 @defopt mm-inlined-types
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
913 This, on the other hand, says what types are to be displayed inline, if
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
914 they satisfy the conditions set by the variable above. It's a list of
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
915 @sc{mime} media types.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
916 @end defopt
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
917
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
918 @defopt mm-automatic-display
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
919 This is a list of types that are to be displayed ``automatically'', but
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
920 only if the above variable allows it. That is, only inlinable parts can
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
921 be displayed automatically.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
922 @end defopt
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
923
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
924 @defopt mm-attachment-override-types
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
925 Some @sc{mime} agents create parts that have a content-disposition of
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
926 @samp{attachment}. This variable allows overriding that disposition and
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
927 displaying the part inline. (Note that the disposition is only
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
928 overridden if we are able to, and want to, display the part inline.)
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
929 @end defopt
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
930
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
931 @defopt mm-discouraged-alternatives
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
932 List of @sc{mime} types that are discouraged when viewing
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
933 @samp{multipart/alternative}. Viewing agents are supposed to view the
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
934 last possible part of a message, as that is supposed to be the richest.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
935 However, users may prefer other types instead, and this list says what
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
936 types are most unwanted. If, for instance, @samp{text/html} parts are
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
937 very unwanted, and @samp{text/richtech} parts are somewhat unwanted,
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
938 then the value of this variable should be set to:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
939
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
940 @lisp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
941 ("text/html" "text/richtext")
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
942 @end lisp
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
943 @end defopt
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
944
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
945 @defopt mm-inline-large-images-p
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
946 When displaying inline images that are larger than the window, XEmacs
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
947 does not enable scrolling, which means that you cannot see the whole
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
948 image. To prevent this, the library tries to determine the image size
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
949 before displaying it inline, and if it doesn't fit the window, the
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
950 library will display it externally (e.g. with @samp{ImageMagick} or
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
951 @samp{xv}). Setting this variable to @code{t} disables this check and
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
952 makes the library display all inline images as inline, regardless of
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
953 their size.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
954 @end defopt
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
955
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
956 @defopt mm-inline-override-p
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
957 @code{mm-inlined-types} may include regular expressions, for example to
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
958 specify that all @samp{text/.*} parts be displayed inline. If a user
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
959 prefers to have a type that matches such a regular expression be treated
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
960 as an attachment, that can be accomplished by setting this variable to a
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
961 list containing that type. For example assuming @code{mm-inlined-types}
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
962 includes @samp{text/.*}, then including @samp{text/html} in this
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
963 variable will cause @samp{text/html} parts to be treated as attachments.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
964 @end defopt
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
965
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
966
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
967 @node New Viewers
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
968 @section New Viewers
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
969
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
970 Here's an example viewer for displaying @samp{text/enriched} inline:
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
971
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
972 @lisp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
973 (defun mm-display-enriched-inline (handle)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
974 (let (text)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
975 (with-temp-buffer
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
976 (mm-insert-part handle)
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
977 (save-window-excursion
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
978 (enriched-decode (point-min) (point-max))
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
979 (setq text (buffer-string))))
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
980 (mm-insert-inline handle text)))
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
981 @end lisp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
982
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
983 We see that the function takes a @sc{mime} handle as its parameter. It
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
984 then goes to a temporary buffer, inserts the text of the part, does some
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
985 work on the text, stores the result, goes back to the buffer it was
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
986 called from and inserts the result.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
987
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
988 The two important helper functions here are @code{mm-insert-part} and
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
989 @code{mm-insert-inline}. The first function inserts the text of the
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
990 handle in the current buffer. It handles charset and/or content
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
991 transfer decoding. The second function just inserts whatever text you
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
992 tell it to insert, but it also sets things up so that the text can be
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
993 ``undisplayed' in a convenient manner.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
994
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
995
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
996 @node Composing
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
997 @chapter Composing
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
998 @cindex Composing
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
999 @cindex MIME Composing
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1000 @cindex MML
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1001 @cindex MIME Meta Language
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1002
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1003 Creating a @sc{mime} message is boring and non-trivial. Therefore, a
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1004 library called @code{mml} has been defined that parses a language called
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1005 MML (@sc{mime} Meta Language) and generates @sc{mime} messages.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1006
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1007 @findex mml-generate-mime
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1008 The main interface function is @code{mml-generate-mime}. It will
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1009 examine the contents of the current (narrowed-to) buffer and return a
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1010 string containing the @sc{mime} message.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1011
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1012 @menu
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1013 * Simple MML Example:: An example MML document.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1014 * MML Definition:: All valid MML elements.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1015 * Advanced MML Example:: Another example MML document.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1016 * Charset Translation:: How charsets are mapped from Mule to MIME.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1017 * Conversion:: Going from @sc{mime} to MML and vice versa.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1018 @end menu
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1019
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1020
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1021 @node Simple MML Example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1022 @section Simple MML Example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1023
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1024 Here's a simple @samp{multipart/alternative}:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1025
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1026 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1027 <#multipart type=alternative>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1028 This is a plain text part.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1029 <#part type=text/enriched>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1030 <center>This is a centered enriched part</center>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1031 <#/multipart>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1032 @end example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1033
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1034 After running this through @code{mml-generate-mime}, we get this:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1035
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1036 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1037 Content-Type: multipart/alternative; boundary="=-=-="
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1038
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1039
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1040 --=-=-=
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1041
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1042
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1043 This is a plain text part.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1044
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1045 --=-=-=
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1046 Content-Type: text/enriched
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1047
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1048
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1049 <center>This is a centered enriched part</center>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1050
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1051 --=-=-=--
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1052 @end example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1053
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1054
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1055 @node MML Definition
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1056 @section MML Definition
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1057
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1058 The MML language is very simple. It looks a bit like an SGML
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1059 application, but it's not.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1060
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1061 The main concept of MML is the @dfn{part}. Each part can be of a
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1062 different type or use a different charset. The way to delineate a part
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1063 is with a @samp{<#part ...>} tag. Multipart parts can be introduced
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1064 with the @samp{<#multipart ...>} tag. Parts are ended by the
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1065 @samp{<#/part>} or @samp{<#/multipart>} tags. Parts started with the
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1066 @samp{<#part ...>} tags are also closed by the next open tag.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1067
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1068 There's also the @samp{<#external ...>} tag. These introduce
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1069 @samp{external/message-body} parts.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1070
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1071 Each tag can contain zero or more parameters on the form
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1072 @samp{parameter=value}. The values may be enclosed in quotation marks,
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1073 but that's not necessary unless the value contains white space. So
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1074 @samp{filename=/home/user/#hello$^yes} is perfectly valid.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1075
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1076 The following parameters have meaning in MML; parameters that have no
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1077 meaning are ignored. The MML parameter names are the same as the
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1078 @sc{mime} parameter names; the things in the parentheses say which
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1079 header it will be used in.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1080
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1081 @table @samp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1082 @item type
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1083 The @sc{mime} type of the part (@samp{Content-Type}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1084
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1085 @item filename
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1086 Use the contents of the file in the body of the part
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1087 (@samp{Content-Disposition}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1088
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1089 @item charset
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1090 The contents of the body of the part are to be encoded in the character
46918
82d113655734 Minor spelling and grammar corrections.
Paul Eggert <eggert@twinsun.com>
parents: 43961
diff changeset
1091 set specified (@samp{Content-Type}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1092
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1093 @item name
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1094 Might be used to suggest a file name if the part is to be saved
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1095 to a file (@samp{Content-Type}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1096
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1097 @item disposition
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1098 Valid values are @samp{inline} and @samp{attachment}
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1099 (@samp{Content-Disposition}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1100
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1101 @item encoding
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1102 Valid values are @samp{7bit}, @samp{8bit}, @samp{quoted-printable} and
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1103 @samp{base64} (@samp{Content-Transfer-Encoding}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1104
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1105 @item description
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1106 A description of the part (@samp{Content-Description}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1107
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1108 @item creation-date
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1109 RFC822 date when the part was created (@samp{Content-Disposition}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1110
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1111 @item modification-date
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1112 RFC822 date when the part was modified (@samp{Content-Disposition}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1113
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1114 @item read-date
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1115 RFC822 date when the part was read (@samp{Content-Disposition}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1116
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1117 @item size
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1118 The size (in octets) of the part (@samp{Content-Disposition}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1119
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1120 @end table
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1121
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1122 Parameters for @samp{application/octet-stream}:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1123
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1124 @table @samp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1125 @item type
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1126 Type of the part; informal---meant for human readers
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1127 (@samp{Content-Type}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1128 @end table
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1129
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1130 Parameters for @samp{message/external-body}:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1131
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1132 @table @samp
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1133 @item access-type
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1134 A word indicating the supported access mechanism by which the file may
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1135 be obtained. Values include @samp{ftp}, @samp{anon-ftp}, @samp{tftp},
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1136 @samp{localfile}, and @samp{mailserver}. (@samp{Content-Type}.)
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1137
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1138 @item expiration
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1139 The RFC822 date after which the file may no longer be fetched.
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1140 (@samp{Content-Type}.)
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1141
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1142 @item size
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1143 The size (in octets) of the file. (@samp{Content-Type}.)
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1144
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1145 @item permission
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1146 Valid values are @samp{read} and @samp{read-write}
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1147 (@samp{Content-Type}).
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1148
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1149 @end table
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1150
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1151
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1152 @node Advanced MML Example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1153 @section Advanced MML Example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1154
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1155 Here's a complex multipart message. It's a @samp{multipart/mixed} that
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1156 contains many parts, one of which is a @samp{multipart/alternative}.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1157
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1158 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1159 <#multipart type=mixed>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1160 <#part type=image/jpeg filename=~/rms.jpg disposition=inline>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1161 <#multipart type=alternative>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1162 This is a plain text part.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1163 <#part type=text/enriched name=enriched.txt>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1164 <center>This is a centered enriched part</center>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1165 <#/multipart>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1166 This is a new plain text part.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1167 <#part disposition=attachment>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1168 This plain text part is an attachment.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1169 <#/multipart>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1170 @end example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1171
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1172 And this is the resulting @sc{mime} message:
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1173
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1174 @example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1175 Content-Type: multipart/mixed; boundary="=-=-="
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1176
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1177
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1178 --=-=-=
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1179
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1180
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1181
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1182 --=-=-=
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1183 Content-Type: image/jpeg;
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1184 filename="~/rms.jpg"
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1185 Content-Disposition: inline;
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1186 filename="~/rms.jpg"
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1187 Content-Transfer-Encoding: base64
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1188
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1189 /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRof
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1190 Hh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCAAwADABAREA/8QAHwAA
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1191 AQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQR
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1192 BRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RF
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1193 RkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ip
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1194 qrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEB
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1195 AAA/AO/rifFHjldNuGsrDa0qcSSHkA+gHrXKw+LtWLrMb+RgTyhbr+HSug07xNqV9fQtZrNI
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1196 AyiaE/NuBPOOOP0rvRNE880KOC8TbXXGCv1FPqjrF4LDR7u5L7SkTFT/ALWOP1xXgTuXfc7E
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1197 sx6nua6rwp4IvvEM8chCxWxOdzn7wz6V9AaB4S07w9p5itow0rDLSY5Pt9K43xO66P4xs71m
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1198 2QXiGCbA4yOVJ9+1aYORkdK434lyNH4ahCnG66VT9Nj15JFbPdX0MS43M4VQf5/yr2vSpLnw
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1199 5ZW8dlCZ8KFXjOPX0/mK6rSPEGt3Angu44fNEReHYNvIH3TzXDeKNO8RX+kSX2ouZkicTIOc
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1200 L+g7E810ulFjpVtv3bwgB3HJyK5L4quY/C9sVxk3ij/xx6850u7t1mtp/wDlpEw3An3Jr3Dw
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1201 34gsbWza4nBlhC5LDsaW6+IFgupQyCF3iHH7gA7c9R9ay7zx6t7aX9jHC4smhfBkGCvHGfrm
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1202 tLQ7hbnRrV1GPkAP1x1/Hr+Ncr8Vzjwrbf8AX6v/AKA9eQRyYlQk8Yx9K6XTNbkgia2ciSIn
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1203 7p5Ga9Atte0LTLKO6it4i7dVRFJDcZ4PvXN+JvEMF9bILVGXJLSZ4zkjivRPDaeX4b08HOTC
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1204 pOffmua+KkbS+GLVUGT9tT/0B68eeIpIFYjB70+OOVXyoOM9+M1eaWeCLzHPyHGO/NVWvJJm
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1205 jQ8KGH1NfQWhXSXmh2c8eArRLwO3HSv/2Q==
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1206
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1207 --=-=-=
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1208 Content-Type: multipart/alternative; boundary="==-=-="
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1209
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1210
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1211 --==-=-=
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1212
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1213
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1214 This is a plain text part.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1215
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1216 --==-=-=
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1217 Content-Type: text/enriched;
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1218 name="enriched.txt"
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1219
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1220
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1221 <center>This is a centered enriched part</center>
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1222
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1223 --==-=-=--
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1224
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1225 --=-=-=
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1226
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1227 This is a new plain text part.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1228
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1229 --=-=-=
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1230 Content-Disposition: attachment
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1231
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1232
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1233 This plain text part is an attachment.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1234
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1235 --=-=-=--
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1236 @end example
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1237
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1238 @node Charset Translation
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1239 @section Charset Translation
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1240 @cindex charsets
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1241
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1242 During translation from MML to @sc{mime}, for each @sc{mime} part which
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1243 has been composed inside Emacs, an appropriate @sc{mime} charset has to
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1244 be chosen.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1245
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1246 @vindex mail-parse-charset
47439
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1247 @cindex unibyte Emacs
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1248 If you are running a non-Mule XEmacs, or Emacs in unibyte
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1249 mode@footnote{Deprecated!}, this process is simple: if the part
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1250 contains any non-@sc{ascii} (8-bit) characters, the @sc{mime} charset
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1251 given by @code{mail-parse-charset} (a symbol) is used. (Never set this
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1252 variable directly, though. If you want to change the default charset,
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1253 please consult the documentation of the package which you use to process
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1254 @sc{mime} messages. @xref{Various Message Variables, , Various Message
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1255 Variables, message, Message Manual}, for example.) If there are only
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1256 @sc{ascii} characters, the @sc{mime} charset @samp{US-ASCII} is used, of
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1257 course.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1258
47439
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1259 @cindex multibyte Emacs
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1260 @cindex @code{mime-charset} property
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1261 In a normal (multibyte) Emacs session, a list of coding systems is
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1262 derived that can encode the message part's content and correspond to
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1263 MIME charsets (according to their @code{mime-charset} property). This
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1264 list is according to the normal priority rules and the highest priority
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1265 one is chosen to encode the part. If no such coding system can encode
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1266 the part's contents, they are split into several parts such that each
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1267 can be encoded with an appropriate coding system/@sc{mime}
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1268 charset.@footnote{The part can only be split at line boundaries,
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1269 though---if more than one @sc{mime} charset is required to encode a
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1270 single line, it is not possible to encode the part.} Note that this
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1271 procedure works with any correctly-defined coding systems, not just
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1272 built-in ones. Given a suitably-defined UTF-8 coding system---one
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1273 capable of encoding the Emacs charsets you use---it is not normally
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1274 necessary to split a part by charset.
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1275
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1276 @vindex mm-mime-mule-charset-alist
47439
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1277 @cindex XEmacs/Mule
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1278 It isn't possible to do this properly in XEmacs/Mule. Instead, a list
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1279 of the Mule charsets used in the part is obtained, and the
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1280 corresponding @sc{mime} charsets are determined by lookup in
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1281 @code{mm-mime-mule-charset-alist}. If the list elements all
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1282 correspond to a single @sc{mime} charset, that is used to encode the
8e23c317f989 (Charset Translation): Fix description of process.
Dave Love <fx@gnu.org>
parents: 46918
diff changeset
1283 part. Otherwise, the part is split as above.
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1284
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1285 @node Conversion
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1286 @section Conversion
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1287
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1288 @findex mime-to-mml
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1289 A (multipart) @sc{mime} message can be converted to MML with the
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1290 @code{mime-to-mml} function. It works on the message in the current
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1291 buffer, and substitutes MML markup for @sc{mime} boundaries.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1292 Non-textual parts do not have their contents in the buffer, but instead
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1293 have the contents in separate buffers that are referred to from the MML
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1294 tags.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1295
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1296 @findex mml-to-mime
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1297 An MML message can be converted back to @sc{mime} by the
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1298 @code{mml-to-mime} function.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1299
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1300 These functions are in certain senses ``lossy''---you will not get back
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1301 an identical message if you run @sc{mime-to-mml} and then
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1302 @sc{mml-to-mime}. Not only will trivial things like the order of the
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1303 headers differ, but the contents of the headers may also be different.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1304 For instance, the original message may use base64 encoding on text,
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1305 while @sc{mml-to-mime} may decide to use quoted-printable encoding, and
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1306 so on.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1307
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1308 In essence, however, these two functions should be the inverse of each
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1309 other. The resulting contents of the message should remain equivalent,
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1310 if not identical.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1311
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1312
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1313 @node Standards
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1314 @chapter Standards
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1315
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1316 The Emacs @sc{mime} library implements handling of various elements
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1317 according to a (somewhat) large number of RFCs, drafts and standards
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1318 documents. This chapter lists the relevant ones. They can all be
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1319 fetched from @samp{http://quimby.gnus.org/notes/}.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1320
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1321 @table @dfn
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1322 @item RFC822
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1323 @itemx STD11
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1324 Standard for the Format of ARPA Internet Text Messages.
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1325
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1326 @item RFC1036
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1327 Standard for Interchange of USENET Messages
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1328
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1329 @item RFC1524
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1330 A User Agent Configuration Mechanism For Multimedia Mail Format
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1331 Information
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1332
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1333 @item RFC2045
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1334 Format of Internet Message Bodies
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1335
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1336 @item RFC2046
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1337 Media Types
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1338
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1339 @item RFC2047
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1340 Message Header Extensions for Non-ASCII Text
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1341
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1342 @item RFC2048
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1343 Registration Procedures
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1344
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1345 @item RFC2049
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1346 Conformance Criteria and Examples
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1347
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1348 @item RFC2231
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1349 MIME Parameter Value and Encoded Word Extensions: Character Sets,
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1350 Languages, and Continuations
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1351
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1352 @item RFC1843
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1353 HZ - A Data Format for Exchanging Files of Arbitrarily Mixed Chinese and
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1354 ASCII characters
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1355
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1356 @item draft-ietf-drums-msg-fmt-05.txt
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1357 Draft for the successor of RFC822
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1358
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1359 @item RFC2112
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1360 The MIME Multipart/Related Content-type
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1361
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1362 @item RFC1892
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1363 The Multipart/Report Content Type for the Reporting of Mail System
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1364 Administrative Messages
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1365
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1366 @item RFC2183
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1367 Communicating Presentation Information in Internet Messages: The
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1368 Content-Disposition Header Field
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1369
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1370 @end table
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1371
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1372
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1373 @node Index
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1374 @chapter Index
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1375 @printindex cp
33435
4ef19e88da9a Various markup and content changes, particularly to use @def... for
Dave Love <fx@gnu.org>
parents: 32258
diff changeset
1376 @printindex fn
31853
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1377
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1378 @summarycontents
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1379 @contents
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1380 @bye
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1381
25af74a14174 *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1382 @c End: