Gnus development mailing list
 help / color / mirror / Atom feed
From: wmperry@aventail.com
Cc: ding@gnus.org
Subject: Re: WIBNI
Date: 14 Jul 1999 08:35:00 -0500	[thread overview]
Message-ID: <86oghfbbi3.fsf@megalith.bp.aventail.com> (raw)
In-Reply-To: Lee Willis's message of "14 Jul 1999 10:52:30 +0100"

Lee Willis <lee@gbdirect.co.uk> writes:

> Just a thought here ...
> 
> Wouldn't it be nice if we could specify filters for certain MIME types.
> What I was specifically thinking of was this:
> 
> When someone sends me a message with a MS Word Document as an
> attachment, I'd like to able to specify that attachments of that type
> (application/ms-word??) get passed to "mswordview %s -o -" which outputs
> HTML on it's standard out, which then gets inserted into the article
> buffer and treated as text/html.
> 
> ie I'd need to configure the four values
> 
> MIME type            Filter       Args   Output type
> "application/msword" "mswordview" "-o -" "text/html"
> 
> And he presto I get W3 rendering a copy of the word document as HTML in
> the article buffer.
> 
> You could also do similar things to convert all images to something your
> Xemacs could handle etc. etc.

Just an FYI - the 'images.el' file distributed with Emacs/W3 does this
right now.  Basically it defines filters from one image type to another
until it finds one your Emacs can handle.

You can add arbitrary image converters using:

-------------------------------------------------------------------------------
`image-register-converter' is a Lisp function
  -- loaded from "/usr/people/wmperry/lisp/development/w3/lisp/images.el"
(image-register-converter FROM TO CONVERTER)

Documentation:
Register the image converter for FROM to TO.  CONVERTER is the actual
command used to convert the image.  If this is a string, it will be executed
in a subprocess.  If a symbol, it is assumed to be a function.  It will be
called with two arguments, the start and end of the data to be converted.
The function should replace that data with the new image data.  The return
value is not significant.
-------------------------------------------------------------------------------

It takes some pains to find the shortest path from one image format to
another.

You then just call image-normalize

-------------------------------------------------------------------------------
`image-normalize' is a Lisp function
  -- loaded from "/usr/people/wmperry/lisp/development/w3/lisp/images.el"
(image-normalize FORMAT DATA)

Documentation:
Return an image specification for XEmacs 19.13 and later.  FORMAT specifies
the image format, DATA is the image data as a string.  Any conversions to get
to a suitable internal image format will be carried out.
-------------------------------------------------------------------------------

The only things I have default image converters for are using the netpbm
image utilities.  So something like:

(image-converter-chain 'ppm 'gif)
=> ("(ppmquant 256 | ppmtogif)")

(image-converter-chain 'ppm 'xpm)
=> ("ppmtoxpm")

image-normalize is a no-op if you can natively understand the image
format.  This only works in XEmacs right now, but I'm going to try and get
the new Emacs redisplay image stuff in there at some point.

-Bill P.


  parent reply	other threads:[~1999-07-14 13:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-14  9:52 WIBNI Lee Willis
1999-07-14 13:16 ` WIBNI Doug Bagley
1999-07-14 13:35 ` wmperry [this message]
1999-08-27 18:19 ` WIBNI Lars Magne Ingebrigtsen
1999-08-27 19:05   ` WIBNI William M. Perry
1999-08-27 19:19     ` WIBNI Lars Magne Ingebrigtsen
1999-08-27 19:56       ` WIBNI William M. Perry
1999-08-30 12:41         ` WIBNI Robert Bihlmeyer
1999-08-27 18:21 ` WIBNI Lars Magne Ingebrigtsen
1999-10-11 15:37 WIBNI Lee Willis
1999-11-06 21:51 ` WIBNI Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86oghfbbi3.fsf@megalith.bp.aventail.com \
    --to=wmperry@aventail.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).