diff options
| author | Dave Love | 2000-11-12 19:07:45 +0000 |
|---|---|---|
| committer | Dave Love | 2000-11-12 19:07:45 +0000 |
| commit | edcfa2404b356506f637337e98de05a08a2b178e (patch) | |
| tree | 0fad0078cd0f8063ba680fbf9aecbb697a8218d6 | |
| parent | c157af51b5592ea64950b3cff73e32aa073a03cf (diff) | |
| download | emacs-edcfa2404b356506f637337e98de05a08a2b178e.tar.gz emacs-edcfa2404b356506f637337e98de05a08a2b178e.zip | |
Various markup and content changes, particularly to use @def... for
functions, variables.
| -rw-r--r-- | man/emacs-mime.texi | 698 |
1 files changed, 395 insertions, 303 deletions
diff --git a/man/emacs-mime.texi b/man/emacs-mime.texi index c7090f55c94..046dbc3c136 100644 --- a/man/emacs-mime.texi +++ b/man/emacs-mime.texi | |||
| @@ -108,9 +108,9 @@ low-level libraries that are described in the next chapter. | |||
| 108 | 108 | ||
| 109 | Standards change, and so programs have to change to fit in the new | 109 | Standards change, and so programs have to change to fit in the new |
| 110 | mold. For instance, RFC2045 describes a syntax for the | 110 | mold. For instance, RFC2045 describes a syntax for the |
| 111 | @code{Content-Type} header that only allows ASCII characters in the | 111 | @code{Content-Type} header that only allows @sc{ascii} characters in the |
| 112 | parameter list. RFC2231 expands on RFC2045 syntax to provide a scheme | 112 | parameter list. RFC2231 expands on RFC2045 syntax to provide a scheme |
| 113 | for continuation headers and non-ASCII characters. | 113 | for continuation headers and non-@sc{ascii} characters. |
| 114 | 114 | ||
| 115 | The traditional way to deal with this is just to update the library | 115 | The traditional way to deal with this is just to update the library |
| 116 | functions to parse the new syntax. However, this is sometimes the wrong | 116 | functions to parse the new syntax. However, this is sometimes the wrong |
| @@ -132,17 +132,15 @@ handles new standards. | |||
| 132 | 132 | ||
| 133 | The following functions are defined by this library: | 133 | The following functions are defined by this library: |
| 134 | 134 | ||
| 135 | @table @code | 135 | @defun mail-header-parse-content-type string |
| 136 | @item mail-header-parse-content-type | 136 | Parse @var{string}, a @code{Content-Type} header, and return a |
| 137 | @findex mail-header-parse-content-type | 137 | content-type list in the following format: |
| 138 | Parse a @code{Content-Type} header and return a list on the following | ||
| 139 | format: | ||
| 140 | 138 | ||
| 141 | @lisp | 139 | @lisp |
| 142 | ("type/subtype" | 140 | ("type/subtype" |
| 143 | (attribute1 . value1) | 141 | (attribute1 . value1) |
| 144 | (attribute2 . value2) | 142 | (attribute2 . value2) |
| 145 | ...) | 143 | @dots{}) |
| 146 | @end lisp | 144 | @end lisp |
| 147 | 145 | ||
| 148 | Here's an example: | 146 | Here's an example: |
| @@ -152,75 +150,77 @@ Here's an example: | |||
| 152 | "image/gif; name=\"b980912.gif\"") | 150 | "image/gif; name=\"b980912.gif\"") |
| 153 | @result{} ("image/gif" (name . "b980912.gif")) | 151 | @result{} ("image/gif" (name . "b980912.gif")) |
| 154 | @end example | 152 | @end example |
| 153 | @end defun | ||
| 155 | 154 | ||
| 156 | @item mail-header-parse-content-disposition | 155 | @defun mail-header-parse-content-disposition string |
| 157 | @findex mail-header-parse-content-disposition | 156 | Parse @var{string}, a @code{Content-Disposition} header, and return a |
| 158 | Parse a @code{Content-Disposition} header and return a list on the same | 157 | content-type list in the format above. |
| 159 | format as the function above. | 158 | @end defun |
| 160 | 159 | ||
| 161 | @item mail-content-type-get | 160 | @defun mail-content-type-get ct attribute |
| 162 | @findex mail-content-type-get | 161 | @findex mail-content-type-get |
| 163 | Takes two parameters---a list on the format above, and an attribute. | 162 | Returns the value of the given @var{attribute} from the content-type |
| 164 | Returns the value of the attribute. | 163 | list @var{ct}. |
| 165 | 164 | ||
| 166 | @example | 165 | @example |
| 167 | (mail-content-type-get | 166 | (mail-content-type-get |
| 168 | '("image/gif" (name . "b980912.gif")) 'name) | 167 | '("image/gif" (name . "b980912.gif")) 'name) |
| 169 | @result{} "b980912.gif" | 168 | @result{} "b980912.gif" |
| 170 | @end example | 169 | @end example |
| 170 | @end defun | ||
| 171 | 171 | ||
| 172 | @item mail-header-encode-parameter | 172 | @defun mail-header-encode-parameter param value |
| 173 | @findex mail-header-encode-parameter | 173 | Takes a parameter string @samp{@var{param}=@var{value}} and returns an |
| 174 | Takes a parameter string and returns an encoded version of the string. | 174 | encoded version of it. This is used for parameters in headers like |
| 175 | This is used for parameters in headers like @code{Content-Type} and | 175 | @samp{Content-Type} and @samp{Content-Disposition}. |
| 176 | @code{Content-Disposition}. | 176 | @end defun |
| 177 | 177 | ||
| 178 | @item mail-header-remove-comments | 178 | @defun mail-header-remove-comments string |
| 179 | @findex mail-header-remove-comments | 179 | Return a comment-free version of @var{string}. |
| 180 | Return a comment-free version of a header. | ||
| 181 | 180 | ||
| 182 | @example | 181 | @example |
| 183 | (mail-header-remove-comments | 182 | (mail-header-remove-comments |
| 184 | "Gnus/5.070027 (Pterodactyl Gnus v0.27) (Finnish Landrace)") | 183 | "Gnus/5.070027 (Pterodactyl Gnus v0.27) (Finnish Landrace)") |
| 185 | @result{} "Gnus/5.070027 " | 184 | @result{} "Gnus/5.070027 " |
| 186 | @end example | 185 | @end example |
| 186 | @end defun | ||
| 187 | 187 | ||
| 188 | @item mail-header-remove-whitespace | 188 | @defun mail-header-remove-whitespace string |
| 189 | @findex mail-header-remove-whitespace | 189 | Remove linear white space from @var{string}. Space inside quoted |
| 190 | Remove linear white space from a header. Space inside quoted strings | 190 | strings and comments is preserved. |
| 191 | and comments is preserved. | ||
| 192 | 191 | ||
| 193 | @example | 192 | @example |
| 194 | (mail-header-remove-whitespace | 193 | (mail-header-remove-whitespace |
| 195 | "image/gif; name=\"Name with spaces\"") | 194 | "image/gif; name=\"Name with spaces\"") |
| 196 | @result{} "image/gif;name=\"Name with spaces\"" | 195 | @result{} "image/gif;name=\"Name with spaces\"" |
| 197 | @end example | 196 | @end example |
| 197 | @end defun | ||
| 198 | 198 | ||
| 199 | @item mail-header-get-comment | 199 | @defun mail-header-get-comment string |
| 200 | @findex mail-header-get-comment | 200 | Return the last comment in @var{string}. |
| 201 | Return the last comment in a header. | ||
| 202 | 201 | ||
| 203 | @example | 202 | @example |
| 204 | (mail-header-get-comment | 203 | (mail-header-get-comment |
| 205 | "Gnus/5.070027 (Pterodactyl Gnus v0.27) (Finnish Landrace)") | 204 | "Gnus/5.070027 (Pterodactyl Gnus v0.27) (Finnish Landrace)") |
| 206 | @result{} "Finnish Landrace" | 205 | @result{} "Finnish Landrace" |
| 207 | @end example | 206 | @end example |
| 207 | @end defun | ||
| 208 | |||
| 208 | 209 | ||
| 209 | @item mail-header-parse-address | 210 | @defun mail-header-parse-address string |
| 210 | @findex mail-header-parse-address | 211 | Parse an address string @var{string} and return a list containing the |
| 211 | Parse an address and return a list containing the mailbox and the | 212 | mailbox and the plaintext name. |
| 212 | plaintext name. | ||
| 213 | 213 | ||
| 214 | @example | 214 | @example |
| 215 | (mail-header-parse-address | 215 | (mail-header-parse-address |
| 216 | "Hrvoje Niksic <hniksic@@srce.hr>") | 216 | "Hrvoje Niksic <hniksic@@srce.hr>") |
| 217 | @result{} ("hniksic@@srce.hr" . "Hrvoje Niksic") | 217 | @result{} ("hniksic@@srce.hr" . "Hrvoje Niksic") |
| 218 | @end example | 218 | @end example |
| 219 | @end defun | ||
| 219 | 220 | ||
| 220 | @item mail-header-parse-addresses | 221 | @defun mail-header-parse-addresses string |
| 221 | @findex mail-header-parse-addresses | 222 | Parse @var{string} as a list of addresses and return a list of elements |
| 222 | Parse a string with list of addresses and return a list of elements like | 223 | like the one described above. |
| 223 | the one described above. | ||
| 224 | 224 | ||
| 225 | @example | 225 | @example |
| 226 | (mail-header-parse-addresses | 226 | (mail-header-parse-addresses |
| @@ -228,55 +228,55 @@ the one described above. | |||
| 228 | @result{} (("hniksic@@srce.hr" . "Hrvoje Niksic") | 228 | @result{} (("hniksic@@srce.hr" . "Hrvoje Niksic") |
| 229 | ("sb@@metis.no" . "Steinar Bang")) | 229 | ("sb@@metis.no" . "Steinar Bang")) |
| 230 | @end example | 230 | @end example |
| 231 | @end defun | ||
| 231 | 232 | ||
| 232 | @item mail-header-parse-date | 233 | @defun mail-header-parse-date string |
| 233 | @findex mail-header-parse-date | 234 | Parse a date @var{string} and return an Emacs time structure. |
| 234 | Parse a date string and return an Emacs time structure. | 235 | @end defun |
| 235 | 236 | ||
| 236 | @item mail-narrow-to-head | 237 | @defun mail-narrow-to-head |
| 237 | @findex mail-narrow-to-head | ||
| 238 | Narrow the buffer to the header section of the buffer. Point is placed | 238 | Narrow the buffer to the header section of the buffer. Point is placed |
| 239 | at the beginning of the narrowed buffer. | 239 | at the beginning of the narrowed buffer. |
| 240 | @end defun | ||
| 240 | 241 | ||
| 241 | @item mail-header-narrow-to-field | 242 | @defun mail-header-narrow-to-field |
| 242 | @findex mail-header-narrow-to-field | ||
| 243 | Narrow the buffer to the header under point. | 243 | Narrow the buffer to the header under point. |
| 244 | @end defun | ||
| 244 | 245 | ||
| 245 | @item mail-encode-encoded-word-region | 246 | @defun mail-encode-encoded-word-region start end |
| 246 | @findex mail-encode-encoded-word-region | 247 | Encode the non-@sc{ascii} words in the region @var{start}to @var{end}. For |
| 247 | Encode the non-ASCII words in the region. For instance, | 248 | instance, @samp{Naïve} is encoded as @samp{=?iso-8859-1?q?Na=EFve?=}. |
| 248 | @samp{Naïve} is encoded as @samp{=?iso-8859-1?q?Na=EFve?=}. | 249 | @end defun |
| 249 | 250 | ||
| 250 | @item mail-encode-encoded-word-buffer | 251 | @defun mail-encode-encoded-word-buffer |
| 251 | @findex mail-encode-encoded-word-buffer | 252 | Encode the non-@sc{ascii} words in the current buffer. This function is |
| 252 | Encode the non-ASCII words in the current buffer. This function is | 253 | meant to be called with the buffer narrowed to the headers of a message. |
| 253 | meant to be called narrowed to the headers of a message. | 254 | @end defun |
| 254 | 255 | ||
| 255 | @item mail-encode-encoded-word-string | 256 | @defun mail-encode-encoded-word-string string |
| 256 | @findex mail-encode-encoded-word-string | 257 | Encode the words that need encoding in @var{string}, and return the |
| 257 | Encode the words that need encoding in a string, and return the result. | 258 | result. |
| 258 | 259 | ||
| 259 | @example | 260 | @example |
| 260 | (mail-encode-encoded-word-string | 261 | (mail-encode-encoded-word-string |
| 261 | "This is naïve, baby") | 262 | "This is naïve, baby") |
| 262 | @result{} "This is =?iso-8859-1?q?na=EFve,?= baby" | 263 | @result{} "This is =?iso-8859-1?q?na=EFve,?= baby" |
| 263 | @end example | 264 | @end example |
| 265 | @end defun | ||
| 264 | 266 | ||
| 265 | @item mail-decode-encoded-word-region | 267 | @defun mail-decode-encoded-word-region start end |
| 266 | @findex mail-decode-encoded-word-region | 268 | Decode the encoded words in the region @var{start}to @var{end}. |
| 267 | Decode the encoded words in the region. | 269 | @end defun |
| 268 | 270 | ||
| 269 | @item mail-decode-encoded-word-string | 271 | @defun mail-decode-encoded-word-string string |
| 270 | @findex mail-decode-encoded-word-string | 272 | Decode the encoded words in @var{string} and return the result. |
| 271 | Decode the encoded words in the string and return the result. | ||
| 272 | 273 | ||
| 273 | @example | 274 | @example |
| 274 | (mail-decode-encoded-word-string | 275 | (mail-decode-encoded-word-string |
| 275 | "This is =?iso-8859-1?q?na=EFve,?= baby") | 276 | "This is =?iso-8859-1?q?na=EFve,?= baby") |
| 276 | @result{} "This is naïve, baby" | 277 | @result{} "This is naïve, baby" |
| 277 | @end example | 278 | @end example |
| 278 | 279 | @end defun | |
| 279 | @end table | ||
| 280 | 280 | ||
| 281 | Currently, @code{mail-parse} is an abstraction over @code{ietf-drums}, | 281 | Currently, @code{mail-parse} is an abstraction over @code{ietf-drums}, |
| 282 | @code{rfc2047}, @code{rfc2045} and @code{rfc2231}. These are documented | 282 | @code{rfc2047}, @code{rfc2045} and @code{rfc2231}. These are documented |
| @@ -304,7 +304,7 @@ on. High-level functionality is dealt with in the next chapter | |||
| 304 | * binhex:: Binhex decoding. | 304 | * binhex:: Binhex decoding. |
| 305 | * uudecode:: Uuencode decoding. | 305 | * uudecode:: Uuencode decoding. |
| 306 | * rfc1843:: Decoding HZ-encoded text. | 306 | * rfc1843:: Decoding HZ-encoded text. |
| 307 | * mailcap:: How parts are displayed is specified by the @file{.mailcap} file | 307 | * mailcap:: How parts are displayed is specified by mailcap files |
| 308 | @end menu | 308 | @end menu |
| 309 | 309 | ||
| 310 | 310 | ||
| @@ -318,19 +318,19 @@ RFCs. | |||
| 318 | 318 | ||
| 319 | So @file{rfc2045.el} has only a single function: | 319 | So @file{rfc2045.el} has only a single function: |
| 320 | 320 | ||
| 321 | @table @code | 321 | @defun rfc2045-encode-string parameter value |
| 322 | @item rfc2045-encode-string | ||
| 323 | @findex rfc2045-encode-string | 322 | @findex rfc2045-encode-string |
| 324 | Takes a parameter and a value and returns a @samp{PARAM=VALUE} string. | 323 | Takes a @var{parameter} and a @var{value} and returns a |
| 325 | @var{value} will be quoted if there are non-safe characters in it. | 324 | @samp{@var{param}=@var{value}} string. @var{value} will be quoted if |
| 326 | @end table | 325 | there are non-safe characters in it. |
| 326 | @end defun | ||
| 327 | 327 | ||
| 328 | 328 | ||
| 329 | @node rfc2231 | 329 | @node rfc2231 |
| 330 | @section rfc2231 | 330 | @section rfc2231 |
| 331 | 331 | ||
| 332 | RFC2231 defines a syntax for the @code{Content-Type} and | 332 | RFC2231 defines a syntax for the @samp{Content-Type} and |
| 333 | @code{Content-Disposition} headers. Its snappy name is @dfn{MIME | 333 | @samp{Content-Disposition} headers. Its snappy name is @dfn{MIME |
| 334 | Parameter Value and Encoded Word Extensions: Character Sets, Languages, | 334 | Parameter Value and Encoded Word Extensions: Character Sets, Languages, |
| 335 | and Continuations}. | 335 | and Continuations}. |
| 336 | 336 | ||
| @@ -347,11 +347,9 @@ They usually aren't this bad, though. | |||
| 347 | 347 | ||
| 348 | The following functions are defined by this library: | 348 | The following functions are defined by this library: |
| 349 | 349 | ||
| 350 | @table @code | 350 | @defun rfc2231-parse-string string |
| 351 | @item rfc2231-parse-string | 351 | Parse a @samp{Content-Type} header @var{string} and return a list |
| 352 | @findex rfc2231-parse-string | 352 | describing its elements. |
| 353 | Parse a @code{Content-Type} header and return a list describing its | ||
| 354 | elements. | ||
| 355 | 353 | ||
| 356 | @example | 354 | @example |
| 357 | (rfc2231-parse-string | 355 | (rfc2231-parse-string |
| @@ -362,19 +360,17 @@ elements. | |||
| 362 | @result{} ("application/x-stuff" | 360 | @result{} ("application/x-stuff" |
| 363 | (title . "This is even more ***fun*** isn't it!")) | 361 | (title . "This is even more ***fun*** isn't it!")) |
| 364 | @end example | 362 | @end example |
| 363 | @end defun | ||
| 365 | 364 | ||
| 366 | @item rfc2231-get-value | 365 | @defun rfc2231-get-value ct attribute |
| 367 | @findex rfc2231-get-value | 366 | Takes a list @var{ct} of the format above and returns the value of the |
| 368 | Takes one of the lists on the format above and returns | 367 | specified @var{attribute}. |
| 369 | the value of the specified attribute. | 368 | @end defun |
| 370 | |||
| 371 | @item rfc2231-encode-string | ||
| 372 | @findex rfc2231-encode-string | ||
| 373 | Encode a parameter in headers likes @code{Content-Type} and | ||
| 374 | @code{Content-Disposition}. | ||
| 375 | |||
| 376 | @end table | ||
| 377 | 369 | ||
| 370 | @defun rfc2231-encode-string parameter value | ||
| 371 | Encode the string @samp{@var{parameter}=@var{value}} for inclusion in | ||
| 372 | headers likes @samp{Content-Type} and @samp{Content-Disposition}. | ||
| 373 | @end defun | ||
| 378 | 374 | ||
| 379 | @node ietf-drums | 375 | @node ietf-drums |
| 380 | @section ietf-drums | 376 | @section ietf-drums |
| @@ -384,61 +380,57 @@ for RFC822. | |||
| 384 | 380 | ||
| 385 | The functions provided by this library include: | 381 | The functions provided by this library include: |
| 386 | 382 | ||
| 387 | @table @code | 383 | @defun ietf-drums-remove-comments string |
| 388 | @item ietf-drums-remove-comments | 384 | Remove the comments from @var{string} and return the result. |
| 389 | @findex ietf-drums-remove-comments | 385 | @end defun |
| 390 | Remove the comments from the argument and return the results. | ||
| 391 | 386 | ||
| 392 | @item ietf-drums-remove-whitespace | 387 | @defun ietf-drums-remove-whitespace string |
| 393 | @findex ietf-drums-remove-whitespace | 388 | Remove linear white space from @var{string} and return the result. |
| 394 | Remove linear white space from the string and return the results. | ||
| 395 | Spaces inside quoted strings and comments are left untouched. | 389 | Spaces inside quoted strings and comments are left untouched. |
| 390 | @end defun | ||
| 396 | 391 | ||
| 397 | @item ietf-drums-get-comment | 392 | @defun ietf-drums-get-comment string |
| 398 | @findex ietf-drums-get-comment | 393 | Return the last most comment from @var{string}. |
| 399 | Return the last most comment from the string. | 394 | @end defun |
| 400 | 395 | ||
| 401 | @item ietf-drums-parse-address | 396 | @defun ietf-drums-parse-address string |
| 402 | @findex ietf-drums-parse-address | 397 | Parse an address @var{string} and return a list of the mailbox and the |
| 403 | Parse an address string and return a list that contains the mailbox and | 398 | plain text name. |
| 404 | the plain text name. | 399 | @end defun |
| 405 | 400 | ||
| 406 | @item ietf-drums-parse-addresses | 401 | @defun ietf-drums-parse-addresses string |
| 407 | @findex ietf-drums-parse-addresses | 402 | Parse @var{string}, containing any number of comma-separated addresses, |
| 408 | Parse a string that contains any number of comma-separated addresses and | 403 | and return a list of mailbox/plain text pairs. |
| 409 | return a list that contains mailbox/plain text pairs. | 404 | @end defun |
| 410 | 405 | ||
| 411 | @item ietf-drums-parse-date | 406 | @defun ietf-drums-parse-date string |
| 412 | @findex ietf-drums-parse-date | 407 | Parse the date @var{string} and return an Emacs time structure. |
| 413 | Parse a date string and return an Emacs time structure. | 408 | @end defun |
| 414 | 409 | ||
| 415 | @item ietf-drums-narrow-to-header | 410 | @defun ietf-drums-narrow-to-header |
| 416 | @findex ietf-drums-narrow-to-header | ||
| 417 | Narrow the buffer to the header section of the current buffer. | 411 | Narrow the buffer to the header section of the current buffer. |
| 418 | 412 | @end defun | |
| 419 | @end table | ||
| 420 | 413 | ||
| 421 | 414 | ||
| 422 | @node rfc2047 | 415 | @node rfc2047 |
| 423 | @section rfc2047 | 416 | @section rfc2047 |
| 424 | 417 | ||
| 425 | RFC2047 (Message Header Extensions for Non-ASCII Text) specifies how | 418 | RFC2047 (Message Header Extensions for Non-ASCII Text) specifies how |
| 426 | non-ASCII text in headers are to be encoded. This is actually rather | 419 | non-@sc{ascii} text in headers are to be encoded. This is actually rather |
| 427 | complicated, so a number of variables are necessary to tweak what this | 420 | complicated, so a number of variables are necessary to tweak what this |
| 428 | library does. | 421 | library does. |
| 429 | 422 | ||
| 430 | The following variables are tweakable: | 423 | The following variables are tweakable: |
| 431 | 424 | ||
| 432 | @table @code | 425 | @defvar rfc2047-default-charset |
| 433 | @item rfc2047-default-charset | ||
| 434 | @vindex rfc2047-default-charset | ||
| 435 | Characters in this charset should not be decoded by this library. | 426 | Characters in this charset should not be decoded by this library. |
| 436 | This defaults to @code{iso-8859-1}. | 427 | This defaults to @samp{iso-8859-1}. |
| 428 | @end defvar | ||
| 437 | 429 | ||
| 438 | @item rfc2047-header-encoding-list | 430 | @defvar rfc2047-header-encoding-list |
| 439 | @vindex rfc2047-header-encoding-list | ||
| 440 | This is an alist of header / encoding-type pairs. Its main purpose is | 431 | This is an alist of header / encoding-type pairs. Its main purpose is |
| 441 | to prevent encoding of certain headers. | 432 | to prevent encoding of certain headers. |
| 433 | @end defvar | ||
| 442 | 434 | ||
| 443 | The keys can either be header regexps, or @code{t}. | 435 | The keys can either be header regexps, or @code{t}. |
| 444 | 436 | ||
| @@ -446,75 +438,83 @@ The values can be either @code{nil}, in which case the header(s) in | |||
| 446 | question won't be encoded, or @code{mime}, which means that they will be | 438 | question won't be encoded, or @code{mime}, which means that they will be |
| 447 | encoded. | 439 | encoded. |
| 448 | 440 | ||
| 449 | @item rfc2047-charset-encoding-alist | 441 | @defvar rfc2047-charset-encoding-alist |
| 450 | @vindex rfc2047-charset-encoding-alist | ||
| 451 | RFC2047 specifies two forms of encoding---@code{Q} (a | 442 | RFC2047 specifies two forms of encoding---@code{Q} (a |
| 452 | Quoted-Printable-like encoding) and @code{B} (base64). This alist | 443 | Quoted-Printable-like encoding) and @code{B} (base64). This alist |
| 453 | specifies which charset should use which encoding. | 444 | specifies which charset should use which encoding. |
| 445 | @end defvar | ||
| 454 | 446 | ||
| 455 | @item rfc2047-encoding-function-alist | 447 | @defvar rfc2047-encoding-function-alist |
| 456 | @vindex rfc2047-encoding-function-alist | ||
| 457 | This is an alist of encoding / function pairs. The encodings are | 448 | This is an alist of encoding / function pairs. The encodings are |
| 458 | @code{Q}, @code{B} and @code{nil}. | 449 | @code{Q}, @code{B} and @code{nil}. |
| 450 | @end defvar | ||
| 459 | 451 | ||
| 460 | @item rfc2047-q-encoding-alist | 452 | @defvar rfc2047-q-encoding-alist |
| 461 | @vindex rfc2047-q-encoding-alist | ||
| 462 | The @code{Q} encoding isn't quite the same for all headers. Some | 453 | The @code{Q} encoding isn't quite the same for all headers. Some |
| 463 | headers allow a narrower range of characters, and that is what this | 454 | headers allow a narrower range of characters, and that is what this |
| 464 | variable is for. It's an alist of header regexps / allowable character | 455 | variable is for. It's an alist of header regexps and allowable character |
| 465 | ranges. | 456 | ranges. |
| 457 | @end defvar | ||
| 466 | 458 | ||
| 467 | @item rfc2047-encoded-word-regexp | 459 | @defvar rfc2047-encoded-word-regexp |
| 468 | @vindex rfc2047-encoded-word-regexp | ||
| 469 | When decoding words, this library looks for matches to this regexp. | 460 | When decoding words, this library looks for matches to this regexp. |
| 461 | @end defvar | ||
| 470 | 462 | ||
| 471 | @end table | 463 | Those were the variables, and these are the functions: |
| 472 | |||
| 473 | Those were the variables, and these are this functions: | ||
| 474 | 464 | ||
| 475 | @table @code | 465 | @defun rfc2047-narrow-to-field |
| 476 | @item rfc2047-narrow-to-field | ||
| 477 | @findex rfc2047-narrow-to-field | ||
| 478 | Narrow the buffer to the header on the current line. | 466 | Narrow the buffer to the header on the current line. |
| 467 | @end defun | ||
| 479 | 468 | ||
| 480 | @item rfc2047-encode-message-header | 469 | @defun rfc2047-encode-message-header |
| 481 | @findex rfc2047-encode-message-header | ||
| 482 | Should be called narrowed to the header of a message. Encodes according | 470 | Should be called narrowed to the header of a message. Encodes according |
| 483 | to @code{rfc2047-header-encoding-alist}. | 471 | to @code{rfc2047-header-encoding-alist}. |
| 472 | @end defun | ||
| 484 | 473 | ||
| 485 | @item rfc2047-encode-region | 474 | @defun rfc2047-encode-region start end |
| 486 | @findex rfc2047-encode-region | 475 | Encodes all encodable words in the region @var{start} to @var{end}. |
| 487 | Encodes all encodable words in the region specified. | 476 | @end defun |
| 488 | 477 | ||
| 489 | @item rfc2047-encode-string | 478 | @defun rfc2047-encode-string string |
| 490 | @findex rfc2047-encode-string | 479 | Encode @var{string} and return the result. |
| 491 | Encode a string and return the results. | 480 | @end defun |
| 492 | 481 | ||
| 493 | @item rfc2047-decode-region | 482 | @defun rfc2047-decode-region start end |
| 494 | @findex rfc2047-decode-region | 483 | Decode the encoded words in the region @var{start} to @var{end}. |
| 495 | Decode the encoded words in the region. | 484 | @end defun |
| 496 | 485 | ||
| 497 | @item rfc2047-decode-string | 486 | @defun rfc2047-decode-string string |
| 498 | @findex rfc2047-decode-string | 487 | Decode @var{string} and return the result. |
| 499 | Decode a string and return the results. | 488 | @end defun |
| 500 | 489 | ||
| 501 | @end table | ||
| 502 | 490 | ||
| 503 | 491 | ||
| 504 | @node time-date | 492 | @node time-date |
| 505 | @section time-date | 493 | @section time-date |
| 506 | 494 | ||
| 507 | While not really a part of the @sc{mime} library, it is convenient to | 495 | While not really a part of the @sc{mime} library, it is convenient to |
| 508 | document this library here. It deals with parsing @code{Date} headers | 496 | document this library here. It deals with parsing @samp{Date} headers |
| 509 | and manipulating time. (Not by using tesseracts, though, I'm sorry to | 497 | and manipulating time. (Not by using tesseracts, though, I'm sorry to |
| 510 | say.) | 498 | say.) |
| 511 | 499 | ||
| 512 | These functions convert between five formats: A date string, an Emacs | 500 | These functions convert between five formats: a date string, an Emacs |
| 513 | time structure, a decoded time list, a second number, and a day number. | 501 | time structure, a decoded time list, a number of seconds, and a day number. |
| 514 | 502 | ||
| 515 | The functions have quite self-explanatory names, so the following just | 503 | The functions have quite self-explanatory names, so the following just |
| 516 | gives an overview of which functions are available. | 504 | gives an overview of which functions are available. |
| 517 | 505 | ||
| 506 | @findex parse-time-string | ||
| 507 | @findex date-to-time | ||
| 508 | @findex time-to-seconds | ||
| 509 | @findex seconds-to-time | ||
| 510 | @findex time-to-day | ||
| 511 | @findex days-to-time | ||
| 512 | @findex time-since | ||
| 513 | @findex time-less-p | ||
| 514 | @findex subtract-time | ||
| 515 | @findex days-between | ||
| 516 | @findex date-leap-year-p | ||
| 517 | @findex time-to-day-in-year | ||
| 518 | @example | 518 | @example |
| 519 | (parse-time-string "Sat Sep 12 12:21:54 1998 +0200") | 519 | (parse-time-string "Sat Sep 12 12:21:54 1998 +0200") |
| 520 | @result{} (54 21 12 12 9 1998 6 nil 7200) | 520 | @result{} (54 21 12 12 9 1998 6 nil 7200) |
| @@ -552,9 +552,9 @@ gives an overview of which functions are available. | |||
| 552 | 552 | ||
| 553 | (time-to-day-in-year '(13818 19266)) | 553 | (time-to-day-in-year '(13818 19266)) |
| 554 | @result{} 255 | 554 | @result{} 255 |
| 555 | |||
| 556 | @end example | 555 | @end example |
| 557 | 556 | ||
| 557 | @findex safe-date-to-time | ||
| 558 | And finally, we have @code{safe-date-to-time}, which does the same as | 558 | And finally, we have @code{safe-date-to-time}, which does the same as |
| 559 | @code{date-to-time}, but returns a zero time if the date is | 559 | @code{date-to-time}, but returns a zero time if the date is |
| 560 | syntactically malformed. | 560 | syntactically malformed. |
| @@ -611,16 +611,14 @@ encoding is very resistant to mangling during transit. @xref{Base | |||
| 611 | @cindex Apple | 611 | @cindex Apple |
| 612 | @cindex Macintosh | 612 | @cindex Macintosh |
| 613 | 613 | ||
| 614 | @code{binhex} is an encoding that originated in Macintosh environments. | 614 | Binhex is an encoding that originated in Macintosh environments. |
| 615 | The following function is supplied to deal with these: | 615 | The following function is supplied to deal with these: |
| 616 | 616 | ||
| 617 | @table @code | 617 | @defun binhex-decode-region start end &optional header-only |
| 618 | @item binhex-decode-region | 618 | Decode the encoded text in the region @var{start} to @var{end}. If |
| 619 | @findex binhex-decode-region | 619 | @var{header-only} is non-@code{nil}, only decode the @samp{binhex} |
| 620 | Decode the encoded text in the region. If given a third parameter, only | 620 | header and return the filename. |
| 621 | decode the @code{binhex} header and return the filename. | 621 | @end defun |
| 622 | |||
| 623 | @end table | ||
| 624 | 622 | ||
| 625 | 623 | ||
| 626 | @node uudecode | 624 | @node uudecode |
| @@ -628,16 +626,15 @@ decode the @code{binhex} header and return the filename. | |||
| 628 | @cindex uuencode | 626 | @cindex uuencode |
| 629 | @cindex uudecode | 627 | @cindex uudecode |
| 630 | 628 | ||
| 631 | @code{uuencode} is probably still the most popular encoding of binaries | 629 | Uuencoding is probably still the most popular encoding of binaries |
| 632 | used on Usenet, although @code{base64} rules the mail world. | 630 | used on Usenet, although Base64 rules the mail world. |
| 633 | 631 | ||
| 634 | The following function is supplied by this package: | 632 | The following function is supplied by this package: |
| 635 | 633 | ||
| 636 | @table @code | 634 | @defun uudecode-decode-region start end &optional file-name |
| 637 | @item uudecode-decode-region | 635 | Decode the text in the region @var{start} to @var{end}. If |
| 638 | @findex uudecode-decode-region | 636 | @var{file-name} is non-@code{nil}, save the result to @var{file-name}. |
| 639 | Decode the text in the region. | 637 | @end defun |
| 640 | @end table | ||
| 641 | 638 | ||
| 642 | 639 | ||
| 643 | @node rfc1843 | 640 | @node rfc1843 |
| @@ -646,8 +643,8 @@ Decode the text in the region. | |||
| 646 | @cindex HZ | 643 | @cindex HZ |
| 647 | @cindex Chinese | 644 | @cindex Chinese |
| 648 | 645 | ||
| 649 | RFC1843 deals with mixing Chinese and ASCII characters in messages. In | 646 | RFC1843 deals with mixing Chinese and @sc{ascii} characters in messages. In |
| 650 | essence, RFC1843 switches between ASCII and Chinese by doing this: | 647 | essence, RFC1843 switches between @sc{ascii} and Chinese by doing this: |
| 651 | 648 | ||
| 652 | @example | 649 | @example |
| 653 | This sentence is in ASCII. | 650 | This sentence is in ASCII. |
| @@ -658,54 +655,133 @@ Simple enough, and widely used in China. | |||
| 658 | 655 | ||
| 659 | The following functions are available to handle this encoding: | 656 | The following functions are available to handle this encoding: |
| 660 | 657 | ||
| 661 | @table @code | 658 | @defun rfc1843-decode-region start end |
| 662 | @item rfc1843-decode-region | 659 | Decode HZ-encoded text in the region @var{start} to @var{end}. |
| 663 | Decode HZ-encoded text in the region. | 660 | @end defun |
| 664 | |||
| 665 | @item rfc1843-decode-string | ||
| 666 | Decode a HZ-encoded string and return the result. | ||
| 667 | 661 | ||
| 668 | @end table | 662 | @defun rfc1843-decode-string string |
| 663 | Decode the HZ-encoded @var{string} and return the result. | ||
| 664 | @end defun | ||
| 669 | 665 | ||
| 670 | 666 | ||
| 671 | @node mailcap | 667 | @node mailcap |
| 672 | @section mailcap | 668 | @section mailcap |
| 673 | 669 | ||
| 674 | The @file{~/.mailcap} file is parsed by most @sc{mime}-aware message | 670 | As specified by RFC 1524, @sc{mime}-aware message handlers parse |
| 675 | handlers and describes how elements are supposed to be displayed. | 671 | @dfn{mailcap} files from a default list, which can be overridden by the |
| 676 | Here's an example file: | 672 | @code{MAILCAP} environment variable. These describe how elements are |
| 673 | supposed to be displayed. Here's an example file: | ||
| 677 | 674 | ||
| 678 | @example | 675 | @example |
| 679 | image/*; gimp -8 %s | 676 | image/*; gimp -8 %s |
| 680 | audio/wav; wavplayer %s | 677 | audio/wav; wavplayer %s |
| 681 | @end example | 678 | @end example |
| 682 | 679 | ||
| 683 | This says that all image files should be displayed with @code{gimp}, and | 680 | This says that all image files should be displayed with @command{gimp}, |
| 684 | that realaudio files should be played by @code{rvplayer}. | 681 | and that realaudio files should be played by @command{rvplayer}. |
| 685 | 682 | ||
| 686 | The @code{mailcap} library parses this file, and provides functions for | 683 | The @code{mailcap} library parses such files, and provides functions for |
| 687 | matching types. | 684 | matching types. |
| 688 | 685 | ||
| 689 | @table @code | 686 | @defvar mailcap-mime-data |
| 690 | @item mailcap-mime-data | 687 | This variable is an alist of alists containing backup viewing rules for |
| 691 | @vindex mailcap-mime-data | 688 | @sc{mime} types. These are overridden by rules for a type found in |
| 692 | This variable is an alist of alists containing backup viewing rules. | 689 | mailcap files. The outer alist is keyed on the major content-type and |
| 690 | the inner alists are keyed on the minor content-type (which can be a | ||
| 691 | regular expression). | ||
| 693 | 692 | ||
| 694 | @end table | 693 | @c Fixme: document this properly! |
| 694 | For example: | ||
| 695 | @example | ||
| 696 | (("application" | ||
| 697 | ("octet-stream" | ||
| 698 | (viewer . mailcap-save-binary-file) | ||
| 699 | (non-viewer . t) | ||
| 700 | (type . "application/octet-stream")) | ||
| 701 | ("plain" | ||
| 702 | (viewer . view-mode) | ||
| 703 | (test fboundp 'view-mode) | ||
| 704 | (type . "text/plain"))) | ||
| 705 | @end example | ||
| 706 | @end defvar | ||
| 707 | |||
| 708 | @defopt mailcap-default-mime-data | ||
| 709 | This variable is the default value of @code{mailcap-mime-data}. It | ||
| 710 | exists to allow setting the value using Custom. It is merged with | ||
| 711 | values from mailcap files by @code{mailcap-parse-mailcaps}. | ||
| 712 | @end defopt | ||
| 713 | |||
| 714 | Although it is not specified by the RFC, @sc{mime} tools normally use a | ||
| 715 | common means of associating file extensions with defualt @sc{mime} types | ||
| 716 | in the absence of other information about the type of a file. The | ||
| 717 | information is found in per-user files @file{~/.mime.types} and system | ||
| 718 | @file{mime.types} files found in quasi-standard places. Here is an | ||
| 719 | example: | ||
| 720 | |||
| 721 | @example | ||
| 722 | application/x-dvi dvi | ||
| 723 | audio/mpeg mpga mpega mp2 mp3 | ||
| 724 | image/jpeg jpeg jpg jpe | ||
| 725 | @end example | ||
| 726 | |||
| 727 | |||
| 728 | @defvar mailcap-mime-extensions | ||
| 729 | This variable is an alist @sc{mime} types keyed by file extensions. | ||
| 730 | This is overridden by entries found in @file{mime.types} files. | ||
| 731 | @end defvar | ||
| 732 | |||
| 733 | @defopt mailcap-default-mime-extensions | ||
| 734 | This variable is the default value of @code{mailcap-mime-extensions}. | ||
| 735 | It exists to allow setting the value using Custom. It is merged with | ||
| 736 | values from mailcap files by @code{mailcap-parse-mimetypes}. | ||
| 737 | @end defopt | ||
| 695 | 738 | ||
| 696 | Interface functions: | 739 | Interface functions: |
| 697 | 740 | ||
| 698 | @table @code | 741 | @defun mailcap-parse-mailcaps &optional path force |
| 699 | @item mailcap-parse-mailcaps | 742 | Parse all the mailcap files specified in a path string @var{path} and |
| 700 | @findex mailcap-parse-mailcaps | 743 | merge them with the values from @code{mailcap-mime-data}. Components of |
| 701 | Parse the @code{~/.mailcap} file. | 744 | @var{path} are separated by the @code{path-separator} character |
| 745 | appropriate for the system. If @var{force} is non-@code{nil}, the files | ||
| 746 | are re-parsed even if they have been parsed already. If @var{path} is | ||
| 747 | omitted, use the value of environment variable @code{MAILCAPS} if it is | ||
| 748 | set; otherwise (on Unix) use the path defined in RFC 1524, plus | ||
| 749 | @file{/usr/local/etc/mailcap}. | ||
| 750 | @end defun | ||
| 702 | 751 | ||
| 703 | @item mailcap-mime-info | 752 | @defun mailcap-parse-mimetypes &optional path force |
| 704 | Takes a @sc{mime} type as its argument and returns the matching viewer. | 753 | Parse all the mimetypes specified in a Unix-style path string @var{path} |
| 754 | and merge them with the values from @code{mailcap-mime-extensions}. | ||
| 755 | Components of @var{path} are separated by the @code{path-separator} | ||
| 756 | character appropriate for the system. If @var{path} is omitted, use the | ||
| 757 | value of environment variable @code{MIMETYPES} if set; otherwise use a | ||
| 758 | default path consistent with that used by @code{mailcap-parse-mailcaps}. | ||
| 759 | If @var{force} is non-@code{nil}, the files are re-parsed even if they | ||
| 760 | have been parsed already. | ||
| 761 | @end defun | ||
| 705 | 762 | ||
| 706 | @end table | 763 | @defun mailcap-mime-info string &optional request |
| 764 | Gets the viewer command for content-type @var{string}. @code{nil} is | ||
| 765 | returned if none is found. Expects @var{string} to be a complete | ||
| 766 | content-type header line. | ||
| 767 | |||
| 768 | If @var{request} is non-@code{nil} it specifies what information to | ||
| 769 | return. If it is nil or the empty string, the viewer (second field of | ||
| 770 | the mailcap entry) will be returned. If it is a string, then the | ||
| 771 | mailcap field corresponding to that string will be returned | ||
| 772 | (@samp{print}, @samp{description}, whatever). If it is a number, all | ||
| 773 | the information for this viewer is returned. If it is @code{all}, then | ||
| 774 | all possible viewers for this type is returned. | ||
| 775 | @end defun | ||
| 707 | 776 | ||
| 777 | @defun mailcap-mime-types | ||
| 778 | This function returns a list of all the defined media types. | ||
| 779 | @end defun | ||
| 708 | 780 | ||
| 781 | @defun mailcap-extension-to-mime extension | ||
| 782 | This function returns the content type defined for a file with the given | ||
| 783 | @var{extension}. | ||
| 784 | @end defun | ||
| 709 | 785 | ||
| 710 | 786 | ||
| 711 | @node Decoding and Viewing | 787 | @node Decoding and Viewing |
| @@ -739,95 +815,102 @@ descend the message, following the structure, and return a tree of | |||
| 739 | @node Handles | 815 | @node Handles |
| 740 | @section Handles | 816 | @section Handles |
| 741 | 817 | ||
| 742 | A @sc{mime} handle is a list that fully describes a @sc{mime} | 818 | A @sc{mime} handle is a list that fully describes a @sc{mime} component. |
| 743 | component. | ||
| 744 | 819 | ||
| 745 | The following macros can be used to access elements in a handle: | 820 | The following macros can be used to access elements from the |
| 821 | @var{handle} argument: | ||
| 746 | 822 | ||
| 747 | @table @code | 823 | @defmac mm-handle-buffer handle |
| 748 | @item mm-handle-buffer | ||
| 749 | @findex mm-handle-buffer | ||
| 750 | Return the buffer that holds the contents of the undecoded @sc{mime} | 824 | Return the buffer that holds the contents of the undecoded @sc{mime} |
| 751 | part. | 825 | part. |
| 826 | @end defmac | ||
| 752 | 827 | ||
| 753 | @item mm-handle-type | 828 | @defmac mm-handle-type handle |
| 754 | @findex mm-handle-type | 829 | Return the parsed @samp{Content-Type} of the part. |
| 755 | Return the parsed @code{Content-Type} of the part. | 830 | @end defmac |
| 756 | 831 | ||
| 757 | @item mm-handle-encoding | 832 | @defmac mm-handle-encoding handle |
| 758 | @findex mm-handle-encoding | 833 | Return the @samp{Content-Transfer-Encoding} of the part. |
| 759 | Return the @code{Content-Transfer-Encoding} of the part. | 834 | @end defmac |
| 760 | 835 | ||
| 761 | @item mm-handle-undisplayer | 836 | @defmac mm-handle-undisplayer handle |
| 762 | @findex mm-handle-undisplayer | 837 | Return the function that can be used to remove the displayed part (if it |
| 763 | Return the object that can be used to remove the displayed part (if it | ||
| 764 | has been displayed). | 838 | has been displayed). |
| 839 | @end defmac | ||
| 765 | 840 | ||
| 766 | @item mm-handle-set-undisplayer | 841 | @defmac mm-handle-set-undisplayer handle function |
| 767 | @findex mm-handle-set-undisplayer | 842 | Set the undisplayer function for the part to function. |
| 768 | Set the undisplayer object. | 843 | @end defmac |
| 769 | 844 | ||
| 770 | @item mm-handle-disposition | 845 | @defmac mm-handle-disposition |
| 771 | @findex mm-handle-disposition | 846 | Return the parsed @samp{Content-Disposition} of the part. |
| 772 | Return the parsed @code{Content-Disposition} of the part. | 847 | @end defmac |
| 773 | 848 | ||
| 774 | @item mm-handle-disposition | 849 | @defmac mm-handle-disposition |
| 775 | @findex mm-handle-disposition | ||
| 776 | Return the description of the part. | 850 | Return the description of the part. |
| 851 | @end defmac | ||
| 777 | 852 | ||
| 778 | @item mm-get-content-id | 853 | @defmac mm-get-content-id id |
| 779 | Returns the handle(s) referred to by @code{Content-ID}. | 854 | Returns the handle(s) referred to by @var{id}, the @samp{Content-ID} of |
| 780 | 855 | the part. | |
| 781 | @end table | 856 | @end defmac |
| 782 | 857 | ||
| 783 | 858 | ||
| 784 | @node Display | 859 | @node Display |
| 785 | @section Display | 860 | @section Display |
| 786 | 861 | ||
| 787 | Functions for displaying, removing and saving. | 862 | Functions for displaying, removing and saving. In the descriptions |
| 788 | 863 | below, `the part' means the @sc{mime} part represented by the | |
| 789 | @table @code | 864 | @var{handle} argument. |
| 790 | @item mm-display-part | 865 | |
| 791 | @findex mm-display-part | 866 | @defun mm-display-part handle &optional no-default |
| 792 | Display the part. | 867 | Display the part. Return @code{nil} if the part is removed, |
| 793 | 868 | @code{inline} if it is displayed inline or @code{external} if it is | |
| 794 | @item mm-remove-part | 869 | displayed externally. If @var{no-default} is non-@code{nil}, the part |
| 795 | @findex mm-remove-part | 870 | is not displayed unless the @sc{mime} type of @var{handle} is defined to |
| 796 | Remove the part (if it has been displayed). | 871 | be displayed inline or there is an display method defined for it; i.e.@: |
| 872 | no default external method will be used. | ||
| 873 | @end defun | ||
| 797 | 874 | ||
| 798 | @item mm-inlinable-p | 875 | @defun mm-remove-part handle |
| 799 | @findex mm-inlinable-p | 876 | Remove the part if it has been displayed. |
| 800 | Say whether a @sc{mime} type can be displayed inline. | 877 | @end defun |
| 801 | 878 | ||
| 802 | @item mm-automatic-display-p | 879 | @defun mm-inlinable-p handle |
| 803 | @findex mm-automatic-display-p | 880 | Return non-@code{nil} if the part can be displayed inline. |
| 804 | Say whether a @sc{mime} type should be displayed automatically. | 881 | @end defun |
| 805 | 882 | ||
| 806 | @item mm-destroy-part | 883 | @defun mm-automatic-display-p handle |
| 807 | @findex mm-destroy-part | 884 | Return non-@code{nil} if the user has requested automatic display of the |
| 808 | Free all resources occupied by a part. | 885 | @sc{mime} type of the part. |
| 886 | @end defun | ||
| 809 | 887 | ||
| 810 | @item mm-save-part | 888 | @defun mm-destroy-part handle |
| 811 | @findex mm-save-part | 889 | Free all the resources used by the part. |
| 812 | Offer to save the part in a file. | 890 | @end defun |
| 813 | 891 | ||
| 814 | @item mm-pipe-part | 892 | @defun mm-save-part handle |
| 815 | @findex mm-pipe-part | 893 | Save the part to a file. The user is prompted for a file name to use. |
| 816 | Offer to pipe the part to some process. | 894 | @end defun |
| 817 | 895 | ||
| 818 | @item mm-interactively-view-part | 896 | @defun mm-pipe-part handle |
| 819 | @findex mm-interactively-view-part | 897 | Pipe the part through a shell command. The user is prompted for the |
| 820 | Prompt for a mailcap method to use to view the part. | 898 | command to use. |
| 899 | @end defun | ||
| 821 | 900 | ||
| 822 | @end table | 901 | @defun mm-interactively-view-part handle |
| 902 | Prompt for a mailcap method to use to view the part and display it | ||
| 903 | externally using that method. | ||
| 904 | @end defun | ||
| 823 | 905 | ||
| 824 | 906 | ||
| 825 | @node Customization | 907 | @node Customization |
| 826 | @section Customization | 908 | @section Customization |
| 827 | 909 | ||
| 828 | @table @code | 910 | The display of @sc{mime} types may be customized with the following |
| 911 | options. | ||
| 829 | 912 | ||
| 830 | @item mm-inline-media-tests | 913 | @defopt mm-inline-media-tests |
| 831 | This is an alist where the key is a @sc{mime} type, the second element | 914 | This is an alist where the key is a @sc{mime} type, the second element |
| 832 | is a function to display the part @dfn{inline} (i.e., inside Emacs), and | 915 | is a function to display the part @dfn{inline} (i.e., inside Emacs), and |
| 833 | the third element is a form to be @code{eval}ed to say whether the part | 916 | the third element is a form to be @code{eval}ed to say whether the part |
| @@ -836,24 +919,28 @@ can be displayed inline. | |||
| 836 | This variable specifies whether a part @emph{can} be displayed inline, | 919 | This variable specifies whether a part @emph{can} be displayed inline, |
| 837 | and, if so, how to do it. It does not say whether parts are | 920 | and, if so, how to do it. It does not say whether parts are |
| 838 | @emph{actually} displayed inline. | 921 | @emph{actually} displayed inline. |
| 922 | @end defopt | ||
| 839 | 923 | ||
| 840 | @item mm-inlined-types | 924 | @defopt mm-inlined-types |
| 841 | This, on the other hand, says what types are to be displayed inline, if | 925 | This, on the other hand, says what types are to be displayed inline, if |
| 842 | they satisfy the conditions set by the variable above. It's a list of | 926 | they satisfy the conditions set by the variable above. It's a list of |
| 843 | @sc{mime} media types. | 927 | @sc{mime} media types. |
| 928 | @end defopt | ||
| 844 | 929 | ||
| 845 | @item mm-automatic-display | 930 | @defopt mm-automatic-display |
| 846 | This is a list of types that are to be displayed ``automatically'', but | 931 | This is a list of types that are to be displayed ``automatically'', but |
| 847 | only if the above variable allows it. That is, only inlinable parts can | 932 | only if the above variable allows it. That is, only inlinable parts can |
| 848 | be displayed automatically. | 933 | be displayed automatically. |
| 934 | @end defopt | ||
| 849 | 935 | ||
| 850 | @item mm-attachment-override-types | 936 | @defopt mm-attachment-override-types |
| 851 | Some @sc{mime} agents create parts that have a content-disposition of | 937 | Some @sc{mime} agents create parts that have a content-disposition of |
| 852 | @samp{attachment}. This variable allows overriding that disposition and | 938 | @samp{attachment}. This variable allows overriding that disposition and |
| 853 | displaying the part inline. (Note that the disposition is only | 939 | displaying the part inline. (Note that the disposition is only |
| 854 | overridden if we are able to, and want to, display the part inline.) | 940 | overridden if we are able to, and want to, display the part inline.) |
| 941 | @end defopt | ||
| 855 | 942 | ||
| 856 | @item mm-discouraged-alternatives | 943 | @defopt mm-discouraged-alternatives |
| 857 | List of @sc{mime} types that are discouraged when viewing | 944 | List of @sc{mime} types that are discouraged when viewing |
| 858 | @samp{multipart/alternative}. Viewing agents are supposed to view the | 945 | @samp{multipart/alternative}. Viewing agents are supposed to view the |
| 859 | last possible part of a message, as that is supposed to be the richest. | 946 | last possible part of a message, as that is supposed to be the richest. |
| @@ -865,8 +952,9 @@ then the value of this variable should be set to: | |||
| 865 | @lisp | 952 | @lisp |
| 866 | ("text/html" "text/richtext") | 953 | ("text/html" "text/richtext") |
| 867 | @end lisp | 954 | @end lisp |
| 955 | @end defopt | ||
| 868 | 956 | ||
| 869 | @item mm-inline-large-images-p | 957 | @defopt mm-inline-large-images-p |
| 870 | When displaying inline images that are larger than the window, XEmacs | 958 | When displaying inline images that are larger than the window, XEmacs |
| 871 | does not enable scrolling, which means that you cannot see the whole | 959 | does not enable scrolling, which means that you cannot see the whole |
| 872 | image. To prevent this, the library tries to determine the image size | 960 | image. To prevent this, the library tries to determine the image size |
| @@ -875,8 +963,9 @@ library will display it externally (e.g. with @samp{ImageMagick} or | |||
| 875 | @samp{xv}). Setting this variable to @code{t} disables this check and | 963 | @samp{xv}). Setting this variable to @code{t} disables this check and |
| 876 | makes the library display all inline images as inline, regardless of | 964 | makes the library display all inline images as inline, regardless of |
| 877 | their size. | 965 | their size. |
| 966 | @end defopt | ||
| 878 | 967 | ||
| 879 | @item mm-inline-override-p | 968 | @defopt mm-inline-override-p |
| 880 | @code{mm-inlined-types} may include regular expressions, for example to | 969 | @code{mm-inlined-types} may include regular expressions, for example to |
| 881 | specify that all @samp{text/.*} parts be displayed inline. If a user | 970 | specify that all @samp{text/.*} parts be displayed inline. If a user |
| 882 | prefers to have a type that matches such a regular expression be treated | 971 | prefers to have a type that matches such a regular expression be treated |
| @@ -884,14 +973,13 @@ as an attachment, that can be accomplished by setting this variable to a | |||
| 884 | list containing that type. For example assuming @code{mm-inlined-types} | 973 | list containing that type. For example assuming @code{mm-inlined-types} |
| 885 | includes @samp{text/.*}, then including @samp{text/html} in this | 974 | includes @samp{text/.*}, then including @samp{text/html} in this |
| 886 | variable will cause @samp{text/html} parts to be treated as attachments. | 975 | variable will cause @samp{text/html} parts to be treated as attachments. |
| 887 | 976 | @end defopt | |
| 888 | @end table | ||
| 889 | 977 | ||
| 890 | 978 | ||
| 891 | @node New Viewers | 979 | @node New Viewers |
| 892 | @section New Viewers | 980 | @section New Viewers |
| 893 | 981 | ||
| 894 | Here's an example viewer for displaying @code{text/enriched} inline: | 982 | Here's an example viewer for displaying @samp{text/enriched} inline: |
| 895 | 983 | ||
| 896 | @lisp | 984 | @lisp |
| 897 | (defun mm-display-enriched-inline (handle) | 985 | (defun mm-display-enriched-inline (handle) |
| @@ -937,7 +1025,7 @@ string containing the @sc{mime} message. | |||
| 937 | * Simple MML Example:: An example MML document. | 1025 | * Simple MML Example:: An example MML document. |
| 938 | * MML Definition:: All valid MML elements. | 1026 | * MML Definition:: All valid MML elements. |
| 939 | * Advanced MML Example:: Another example MML document. | 1027 | * Advanced MML Example:: Another example MML document. |
| 940 | * Charset Translation:: How charsets are mapped from @sc{mule} to MIME. | 1028 | * Charset Translation:: How charsets are mapped from Mule to MIME. |
| 941 | * Conversion:: Going from @sc{mime} to MML and vice versa. | 1029 | * Conversion:: Going from @sc{mime} to MML and vice versa. |
| 942 | @end menu | 1030 | @end menu |
| 943 | 1031 | ||
| @@ -1004,42 +1092,42 @@ header it will be used in. | |||
| 1004 | 1092 | ||
| 1005 | @table @samp | 1093 | @table @samp |
| 1006 | @item type | 1094 | @item type |
| 1007 | The @sc{mime} type of the part (@code{Content-Type}). | 1095 | The @sc{mime} type of the part (@samp{Content-Type}). |
| 1008 | 1096 | ||
| 1009 | @item filename | 1097 | @item filename |
| 1010 | Use the contents of the file in the body of the part | 1098 | Use the contents of the file in the body of the part |
| 1011 | (@code{Content-Disposition}). | 1099 | (@samp{Content-Disposition}). |
| 1012 | 1100 | ||
| 1013 | @item charset | 1101 | @item charset |
| 1014 | The contents of the body of the part are to be encoded in the character | 1102 | The contents of the body of the part are to be encoded in the character |
| 1015 | set speficied (@code{Content-Type}). | 1103 | set speficied (@samp{Content-Type}). |
| 1016 | 1104 | ||
| 1017 | @item name | 1105 | @item name |
| 1018 | Might be used to suggest a file name if the part is to be saved | 1106 | Might be used to suggest a file name if the part is to be saved |
| 1019 | to a file (@code{Content-Type}). | 1107 | to a file (@samp{Content-Type}). |
| 1020 | 1108 | ||
| 1021 | @item disposition | 1109 | @item disposition |
| 1022 | Valid values are @samp{inline} and @samp{attachment} | 1110 | Valid values are @samp{inline} and @samp{attachment} |
| 1023 | (@code{Content-Disposition}). | 1111 | (@samp{Content-Disposition}). |
| 1024 | 1112 | ||
| 1025 | @item encoding | 1113 | @item encoding |
| 1026 | Valid values are @samp{7bit}, @samp{8bit}, @samp{quoted-printable} and | 1114 | Valid values are @samp{7bit}, @samp{8bit}, @samp{quoted-printable} and |
| 1027 | @samp{base64} (@code{Content-Transfer-Encoding}). | 1115 | @samp{base64} (@samp{Content-Transfer-Encoding}). |
| 1028 | 1116 | ||
| 1029 | @item description | 1117 | @item description |
| 1030 | A description of the part (@code{Content-Description}). | 1118 | A description of the part (@samp{Content-Description}). |
| 1031 | 1119 | ||
| 1032 | @item creation-date | 1120 | @item creation-date |
| 1033 | RFC822 date when the part was created (@code{Content-Disposition}). | 1121 | RFC822 date when the part was created (@samp{Content-Disposition}). |
| 1034 | 1122 | ||
| 1035 | @item modification-date | 1123 | @item modification-date |
| 1036 | RFC822 date when the part was modified (@code{Content-Disposition}). | 1124 | RFC822 date when the part was modified (@samp{Content-Disposition}). |
| 1037 | 1125 | ||
| 1038 | @item read-date | 1126 | @item read-date |
| 1039 | RFC822 date when the part was read (@code{Content-Disposition}). | 1127 | RFC822 date when the part was read (@samp{Content-Disposition}). |
| 1040 | 1128 | ||
| 1041 | @item size | 1129 | @item size |
| 1042 | The size (in octets) of the part (@code{Content-Disposition}). | 1130 | The size (in octets) of the part (@samp{Content-Disposition}). |
| 1043 | 1131 | ||
| 1044 | @end table | 1132 | @end table |
| 1045 | 1133 | ||
| @@ -1048,7 +1136,7 @@ Parameters for @samp{application/octet-stream}: | |||
| 1048 | @table @samp | 1136 | @table @samp |
| 1049 | @item type | 1137 | @item type |
| 1050 | Type of the part; informal---meant for human readers | 1138 | Type of the part; informal---meant for human readers |
| 1051 | (@code{Content-Type}). | 1139 | (@samp{Content-Type}). |
| 1052 | @end table | 1140 | @end table |
| 1053 | 1141 | ||
| 1054 | Parameters for @samp{message/external-body}: | 1142 | Parameters for @samp{message/external-body}: |
| @@ -1057,18 +1145,18 @@ Parameters for @samp{message/external-body}: | |||
| 1057 | @item access-type | 1145 | @item access-type |
| 1058 | A word indicating the supported access mechanism by which the file may | 1146 | A word indicating the supported access mechanism by which the file may |
| 1059 | be obtained. Values include @samp{ftp}, @samp{anon-ftp}, @samp{tftp}, | 1147 | be obtained. Values include @samp{ftp}, @samp{anon-ftp}, @samp{tftp}, |
| 1060 | @samp{localfile}, and @samp{mailserver}. (@code{Content-Type}.) | 1148 | @samp{localfile}, and @samp{mailserver}. (@samp{Content-Type}.) |
| 1061 | 1149 | ||
| 1062 | @item expiration | 1150 | @item expiration |
| 1063 | The RFC822 date after which the file may no longer be fetched. | 1151 | The RFC822 date after which the file may no longer be fetched. |
| 1064 | (@code{Content-Type}.) | 1152 | (@samp{Content-Type}.) |
| 1065 | 1153 | ||
| 1066 | @item size | 1154 | @item size |
| 1067 | The size (in octets) of the file. (@code{Content-Type}.) | 1155 | The size (in octets) of the file. (@samp{Content-Type}.) |
| 1068 | 1156 | ||
| 1069 | @item permission | 1157 | @item permission |
| 1070 | Valid values are @samp{read} and @samp{read-write} | 1158 | Valid values are @samp{read} and @samp{read-write} |
| 1071 | (@code{Content-Type}). | 1159 | (@samp{Content-Type}). |
| 1072 | 1160 | ||
| 1073 | @end table | 1161 | @end table |
| 1074 | 1162 | ||
| @@ -1164,38 +1252,37 @@ This plain text part is an attachment. | |||
| 1164 | @cindex charsets | 1252 | @cindex charsets |
| 1165 | 1253 | ||
| 1166 | During translation from MML to @sc{mime}, for each @sc{mime} part which | 1254 | During translation from MML to @sc{mime}, for each @sc{mime} part which |
| 1167 | has been composed inside Emacs, an appropriate charset has to be chosen. | 1255 | has been composed inside Emacs, an appropriate @sc{mime} charset has to |
| 1256 | be chosen. | ||
| 1168 | 1257 | ||
| 1169 | @vindex mail-parse-charset | 1258 | @vindex mail-parse-charset |
| 1170 | If you are running a non-@sc{mule} Emacs, this process is simple: If the | 1259 | If you are running a non-Mule Emacs, this process is simple: if the part |
| 1171 | part contains any non-ASCII (8-bit) characters, the @sc{mime} charset | 1260 | contains any non-@sc{ascii} (8-bit) characters, the @sc{mime} charset |
| 1172 | given by @code{mail-parse-charset} (a symbol) is used. (Never set this | 1261 | given by @code{mail-parse-charset} (a symbol) is used. (Never set this |
| 1173 | variable directly, though. If you want to change the default charset, | 1262 | variable directly, though. If you want to change the default charset, |
| 1174 | please consult the documentation of the package which you use to process | 1263 | please consult the documentation of the package which you use to process |
| 1175 | @sc{mime} messages. | 1264 | @sc{mime} messages. @xref{Various Message Variables, , Various Message |
| 1176 | @xref{Various Message Variables, , Various Message Variables, message, | 1265 | Variables, message, Message Manual}, for example.) If there are only |
| 1177 | Message Manual}, for example.) | 1266 | @sc{ascii} characters, the @sc{mime} charset @samp{US-ASCII} is used, of |
| 1178 | If there are only ASCII characters, the @sc{mime} charset US-ASCII is | 1267 | course. |
| 1179 | used, of course. | ||
| 1180 | 1268 | ||
| 1181 | @cindex MULE | 1269 | @cindex Mule |
| 1182 | @cindex UTF-8 | 1270 | @cindex UTF-8 |
| 1183 | @cindex Unicode | 1271 | @cindex Unicode |
| 1184 | @vindex mm-mime-mule-charset-alist | 1272 | @vindex mm-mime-mule-charset-alist |
| 1185 | Things are slightly more complicated when running Emacs with @sc{mule} | 1273 | Things are slightly more complicated when running Emacs with Mule |
| 1186 | support. In this case, a list of the @sc{mule} charsets used in the | 1274 | support. In this case, a list of the Mule charsets used in the part is |
| 1187 | part is obtained, and the @sc{mule} charsets are translated to @sc{mime} | 1275 | obtained, and the corresponding @sc{mime} charsets are determined. If |
| 1188 | charsets by consulting the variable @code{mm-mime-mule-charset-alist}. | 1276 | this results in a single @sc{mime} charset, this is used to encode the |
| 1189 | If this results in a single @sc{mime} charset, this is used to encode | 1277 | part. But if the resulting list of @sc{mime} charsets contains more |
| 1190 | the part. But if the resulting list of @sc{mime} charsets contains more | 1278 | than one element, two things can happen: if it is possible to encode the |
| 1191 | than one element, two things can happen: If it is possible to encode the | 1279 | part via UTF-8, this charset is used. (For this, Emacs must support the |
| 1192 | part via UTF-8, this charset is used. (For this, Emacs must support | 1280 | @code{utf-8} coding system, and the part must consist entirely of |
| 1193 | the @code{utf-8} coding system, and the part must consist entirely of | 1281 | characters which have Unicode counterparts.) If UTF-8 is not available, |
| 1194 | characters which have Unicode counterparts.) If UTF-8 is not available | 1282 | the part is split into several, so that each one can be encoded with a |
| 1195 | for some reason, the part is split into several ones, so that each one | 1283 | single @sc{mime} charset. The part can only be split at line |
| 1196 | can be encoded with a single @sc{mime} charset. The part can only be | 1284 | boundaries, though---if more than one @sc{mime} charset is required to |
| 1197 | split at line boundaries, though---if more than one @sc{mime} charset is | 1285 | encode a single line, it is not possible to encode the part. |
| 1198 | required to encode a single line, it is not possible to encode the part. | ||
| 1199 | 1286 | ||
| 1200 | @node Conversion | 1287 | @node Conversion |
| 1201 | @section Conversion | 1288 | @section Conversion |
| @@ -1241,6 +1328,10 @@ Standard for the Format of ARPA Internet Text Messages. | |||
| 1241 | @item RFC1036 | 1328 | @item RFC1036 |
| 1242 | Standard for Interchange of USENET Messages | 1329 | Standard for Interchange of USENET Messages |
| 1243 | 1330 | ||
| 1331 | @item RFC1524 | ||
| 1332 | A User Agent Configuration Mechanism For Multimedia Mail Format | ||
| 1333 | Information | ||
| 1334 | |||
| 1244 | @item RFC2045 | 1335 | @item RFC2045 |
| 1245 | Format of Internet Message Bodies | 1336 | Format of Internet Message Bodies |
| 1246 | 1337 | ||
| @@ -1284,6 +1375,7 @@ Content-Disposition Header Field | |||
| 1284 | @node Index | 1375 | @node Index |
| 1285 | @chapter Index | 1376 | @chapter Index |
| 1286 | @printindex cp | 1377 | @printindex cp |
| 1378 | @printindex fn | ||
| 1287 | 1379 | ||
| 1288 | @summarycontents | 1380 | @summarycontents |
| 1289 | @contents | 1381 | @contents |