* Re: MIME things
1998-09-10 8:07 MIME things Lars Magne Ingebrigtsen
@ 1998-09-10 8:28 ` SL Baur
1998-09-10 13:33 ` William M. Perry
1998-09-10 9:05 ` Hrvoje Niksic
1 sibling, 1 reply; 6+ messages in thread
From: SL Baur @ 1998-09-10 8:28 UTC (permalink / raw)
Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes in ding@gnus.org:
> So, I've written some MIME non-plain-text things, and mm.el handles
> mailcap parsing OK, but what I wonder is how to specify which elements
> that can be (and should be) displayed inline.
> For instance, XEmacs can display GIF (and possibly PNG); some versions
> can do sound; etc. Does anyone have a list of which things I should
> check for, and how to check for them?
XEmacs prefers PNG rather than GIF, but never mind. I'm a little hazy
on what all we currently have implemented for MS Windows.
image/jpeg (featurep 'jpeg)
image/png (featurep 'png)
image/gif (featurep 'gif)
image/tiff (featurep 'tiff)
XBMs are displayable on any XEmacs with any non-tty window-system.
XPMs are displayable if (featurep 'xpm).
BMP is displayable by the MS Windows port (I think), but I'm not sure
what the test is.
.au and .wav are "displayable" in Linux and BSD. .au is displayable
in SunOS/Solaris. .au is "displayable" with netaudio (I don't know
what the test is).
Given how annoying automatic sounds[1] are and how XEmacs doesn't support
backgrounded sounds, I'd personally recommend throwing all of these at
showaudio via pushbutton by default.
> (I think I will also add pop-up menus to allow people to choose
> interactively if they don't like the defaults and stuff.
Excellent.
> (As a first approximation on the "presentation" front, I'm doing
> TM-style buttons and stuff, but the dissection and presentation
> library looks like it's going to be as general as I wanted it to
> be.))
Cool.
Footnotes:
[1] Yeah, yeah, yeah, I know about earcons.el. :-(
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: MIME things
1998-09-10 8:07 MIME things Lars Magne Ingebrigtsen
1998-09-10 8:28 ` SL Baur
@ 1998-09-10 9:05 ` Hrvoje Niksic
1 sibling, 0 replies; 6+ messages in thread
From: Hrvoje Niksic @ 1998-09-10 9:05 UTC (permalink / raw)
Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:
> So, I've written some MIME non-plain-text things, and mm.el handles
> mailcap parsing OK, but what I wonder is how to specify which elements
> that can be (and should be) displayed inline.
>
> For instance, XEmacs can display GIF (and possibly PNG); some versions
> can do sound; etc. Does anyone have a list of which things I should
> check for, and how to check for them?
It would be a good idea to look how others have done this before
reinventing the wheel. I recommend looking at the appropriate
configuration in VM. Others will undoubtedly recommend TM (hi
Steve!:-).
Here is the VM stuff:
(defvar vm-display-using-mime t
"*Non-nil value means VM should display messages using MIME.
MIME (Multipurpose Internet Mail Extensions) is a set of
extensions to the standard Internet message format that allows
reliable tranmission and reception of arbitrary data including
images, audio and video as well as ordinary text.
A non-nil value for this variable means that VM will recognize
MIME encoded messages and display them as specified by the
various MIME standards specifications.
A nil value means VM will not display MIME messages any
differently than any other message.")
;; this is t because at this time (11 April 1997) Solaris is
;; generated too many mangled MIME version headers. For the same
;; reason vm-mime-avoid-folding-content-type is also set to t.
(defvar vm-mime-ignore-mime-version t
"*Non-nil value means ignore the version number in the MIME-Version
header. VM only knows how to decode and display MIME version 1.0
messages. Some systems scramble the MIME-Version header, causing
VM to believe that it cannot display a message that it actually
can display. You can set vm-mime-ignore-mime-version non-nil if
you use such systems.")
;; try to avoid bad interaction with TM
(defvar vm-send-using-mime (not (featurep 'mime-setup))
"*Non-nil value means VM should support sending messages using MIME.
MIME (Multipurpose Internet Mail Extensions) is a set of
extensions to the standard Internet message format that allows
reliable tranmission and reception of arbitrary data including
images, audio and video as well as traditional text.
A non-nil value for this variable means that VM will
- allow you to attach files and messages to your outbound message.
- analyze the composition buffer when you send off a message and
encode it as needed.
A nil value means VM will not offer any support for composing
MIME messages.")
(defvar vm-honor-mime-content-disposition nil
"*Non-nil value means use information from the Content-Disposition header
to display MIME messages. The Content-Disposition header
specifies whether a MIME object should be displayed inline or
treated as an attachment. For VM, ``inline'' display means
displaying the object in the Emacs buffer, if possible.
Attachments will be displayed as a button that you can use
mouse-2 to activate or mouse-3 to pull up a menu of options.")
(defvar vm-auto-decode-mime-messages nil
"*Non-nil value causes MIME decoding to occur automatically
when a message containing MIME objects is exposed. A nil value
means that you will have to run the `vm-decode-mime-message'
command (normally bound to `D') manually to decode and display
MIME objects.")
(defvar vm-auto-displayed-mime-content-types '("text" "multipart")
"*List of MIME content types that should be displayed immediately
after decoding. Other types will be displayed as a button that
the user must activate to display the object.
A value of t means that all types should be displayed immediately.
A nil value means never display MIME objects immediately; only use buttons.
If the value is a list, it should be a list of strings, which
should all be types or type/subtype pairs. Example:
(setq vm-auto-displayed-mime-content-types '(\"text\" \"image/jpeg\"))
If a top-level type is listed without a subtype, all subtypes of
that type are assumed to be included.
Note that some types are processed specially, and this variable does not
apply to them.
multipart/digest messages are always displayed as a button to
avoid automatically visiting a new folder while you are moving
around in the current folder.
message/partial messages are always displayed as a button,
because there always needs to be a way to trigger the assembly
of the parts into a full message.
Any type that cannot be displayed internally or externally will
be displayed as a button that allows you to save the body to a
file.")
(defvar vm-mime-internal-content-types t
"*List of MIME content types that should be displayed internally
if Emacs is capable of doing so. A value of t means that VM
should always display an object internally if possible. A nil
value means never display MIME objects internally, which means VM
have to run an external viewer to display MIME objects.
If the value is a list, it should be a list of strings. Example:
(setq vm-mime-internal-content-types '(\"text\" \"image/jpeg\"))
If a top-level type is listed without a subtype, all subtypes of
that type are assumed to be included.
Note that all multipart types are always handled internally.
There is no need to list them here.")
(defvar vm-mime-external-content-types-alist nil
"*Alist of MIME content types and the external programs used to display them.
If VM cannot display a type internally or has been instructed not
to (see the documentation for the vm-mime-internal-content-types
variable) it will try to launch an external program to display that
type.
The alist format is
( (TYPE PROGRAM ARG ARG ... ) ... )
TYPE is a string specifying a MIME type or type/subtype pair.
Example \"text\" or \"image/jpeg\". If a top-level type is
listed without a subtype, all subtypes of that type are assumed
to be included.
PROGRAM is a string naming a program to run to display an object.
Any ARGS will be passed to the program as arguments. The octets
that compose the object will be written into a file and the name
of the file will be passed to the program as its last argument.
Example:
(setq vm-mime-external-content-types-alist
'(
(\"text/html\" \"netscape\")
(\"image/gif\" \"xv\")
(\"image/jpeg\" \"xv\")
(\"video/mpeg\" \"mpeg_play\")
(\"video\" \"xanim\")
)
)
The first matching list element will be used.
No multipart message will ever be sent to an external viewer.")
(defvar vm-mime-type-converter-alist nil
"*Alist of MIME types and programs that can convert between them.
If VM cannot display a content type, it will scan this list to
see if the type can be converted into a type that it can display.
The alist format is
( (START-TYPE END-TYPE COMMAND-LINE ) ... )
START-TYPE is a string specifying a MIME type or type/subtype pair.
Example \"text\" or \"image/jpeg\". If a top-level type is
listed without a subtype, all subtypes of that type are assumed
to be included.
END-TYPE must be an exact type/subtype pair. This is the type
to which START-TYPE will be converted.
COMMAND-LINE is a string giving a command line to be passed to
the shell. The octets that compose the object will be written to
the standard input of the shell command.
Example:
(setq vm-mime-type-converter-alist
'(
(\"image/jpeg\" \"image/gif\" \"jpeg2gif\")
(\"text/html\" \"text/plain\" \"striptags\")
)
)
The first matching list element will be used.")
(defvar vm-mime-alternative-select-method 'best-internal
"*Value tells how to choose which multipart/alternative part to display.
A MIME message of type multipart/alternative has multiple message
parts containing the same information, but each part may be
formatted differently. VM will display only one of the parts.
This variable tells VM how to choose which part to display.
A value of 'best means choose the part that is the most faithful to
the sender's original content that can be displayed.
A value of 'best-internal means choose the best part that can be
displayed internally, i.e. with the built-in capabilities of Emacs.
If none of the parts can be displayed internally, behavior reverts to
that of 'best.")
(defvar vm-mime-default-face-charsets '("us-ascii" "iso-8859-1")
"*List of character sets that can use the `default' face.
For other characters sets VM will have to create a new face and assign
a font to it that can be used to display that character set.")
(defvar vm-mime-charset-font-alist nil
"*Assoc list of character sets and fonts that can be used to display them.
The format of the list is:
( (CHARSET . FONT) ...)
CHARSET is a string naming a MIME registered character set such
as \"iso-8859-5\". Character set names should be specified in
lower case.
FONT is a string naming a font that can be used to display CHARSET.
An example setup might be:
(setq vm-mime-charset-font-alist
'(
(\"iso-8859-7\" . \"-*-*-medium-r-normal-*-16-160-72-72-c-80-iso8859-7\")
)
)
This variable is only useful for character sets whose characters
can all be encoded in single 8-bit bytes. Also multiple fonts
can only be displayed if you're running under a window system
e.g. X windows. So this variable will have no effect if you're
running Emacs on a tty.
Note that under FSF Emacs any fonts you use must be the same height
as your default font. XEmacs does not have this limitation.")
(defvar vm-mime-button-face 'gui-button-face
"*Face used for text in buttons that trigger the display of MIME objects.")
(defvar vm-mime-8bit-composition-charset "iso-8859-1"
"*Character set that VM should assume if it finds non-US-ASCII characters
in a composition buffer. Composition buffers are assumed to use
US-ASCII unless the buffer contains a byte with the high bit set.
This variable specifies what character set VM should assume if
such a character is found.
This variable is unused in XEmacs/MULE. Since multiple character
sets can be displayed in a single buffer under MULE, VM will map
the file coding system of the buffer to a single MIME character
set that can display all the buffer's characters.")
(defvar vm-mime-8bit-text-transfer-encoding 'quoted-printable
"*Symbol specifying what kind of transfer encoding to use on 8bit
text. Characters with the high bit set cannot safely pass
through all mail gateways and mail transport software. MIME has
two transfer encodings that convert 8-bit data to 7-bit for safe
transport. Quoted-printable leaves the text mostly readable even
if the recipient does not have a MIME-capable mail reader. BASE64
is unreadable without a MIME-capable mail reader, unless your name
is U3BvY2s=.
A value of 'quoted-printable, means to use quoted-printable encoding.
A value of 'base64 means to use BASE64 encoding.
A value of '8bit means to send the message as is.
Note that this variable usually only applies to textual MIME
content types. Images, audio, video, etc. typically will have
some attribute that makes VM consider them to be \"binary\",
which moves them outside the scope of this variable. For
example, messages with line lengths of 1000 characters or more
are considered binary, as are messages that contain carriage
returns (ascii code 13) or NULs (ascii code 0).")
(defvar vm-mime-composition-armor-from-lines nil
"*Non-nil value means \"From \" lines should be armored before sending.
A line beginning with \"From \" is considered a message separator
by many mail delivery agents. These agents will often insert a >
before the word \"From\" to prevent mail readers from being
confused. This is proper behavior, but it breaks digitally signed
messages, which require bit-perfect transport in order for the
message contents to be considered genuine.
If vm-mime-composition-armor-from-lines is non-nil, a line
beginning with \"From \" will cause VM to encode the message
using either quoted-printable or BASE64 encoding so that the From
line can be protected.")
(defvar vm-mime-attachment-auto-type-alist
'(
("\\.jpe?g" . "image/jpeg")
("\\.gif" . "image/gif")
("\\.png" . "image/png")
("\\.tiff?" . "image/tiff")
("\\.html?" . "text/html")
("\\.au" . "audio/basic")
("\\.mpe?g" . "video/mpeg")
("\\.ps" . "application/postscript")
)
"*Alist used to guess a MIME content type based on a file name.
The list format is
((REGEXP . TYPE) ...)
REGEXP is a string that specifies a regular expression.
TYPE is a string specifying a MIME content type.
When a non-MIME file is attached to a MIME composition buffer,
this list will be scanned until a REGEXP matches the file's name.
The corresponding TYPE will be offered as a default when you are
prompted for the file's type.")
(defvar vm-mime-max-message-size nil
"*Largest MIME message that VM should send without fragmentation.
The value should be a integer which specifies the size in bytes.
A message larger than this value will be split into multiple parts
for transmission using the MIME message/partial type.")
(defvar vm-mime-attachment-save-directory nil
"*Non-nil value is a default directory for saving MIME attachments.
When VM prompts you for a target file name when saving a MIME body,
any relative pathnames will be relative to this directory.")
(defvar vm-mime-avoid-folding-content-type t
"*Non-nil means don't send folded Content- headers in MIME messages.
`Folded' headers are headers broken into multiple lines as specified
in RFC822 for readability and to avoid excessive line lengths. At
least one major UNIX vendor ships a version of sendmail that believes
a folded Content-Type header is a syntax error, and returns any such
message to sender. A typical error message from such a sendmail
version is,
553 header syntax error, line \" charset=us-ascii\"
If you see one of these, setting vm-mime-avoid-folding-content-type
non-nil may let your mail get through.")
--
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Which is worse: ignorance or apathy? Who knows? Who cares?
^ permalink raw reply [flat|nested] 6+ messages in thread