From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/24238 Path: main.gmane.org!not-for-mail From: wmperry@aventail.com Newsgroups: gmane.emacs.gnus.general Subject: Re: WIBNI Date: 14 Jul 1999 08:35:00 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: <86oghfbbi3.fsf@megalith.bp.aventail.com> References: Reply-To: wmperry@aventail.com NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035161839 7630 80.91.224.250 (21 Oct 2002 00:57:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 00:57:19 +0000 (UTC) Cc: ding@gnus.org Return-Path: Original-Received: from farabi.math.uh.edu (farabi.math.uh.edu [129.7.128.57]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id LAA02093 for ; Wed, 14 Jul 1999 11:35:15 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by farabi.math.uh.edu (8.9.1/8.9.1) with ESMTP id KAB02830; Wed, 14 Jul 1999 10:35:00 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 14 Jul 1999 10:35:50 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id KAA19884 for ; Wed, 14 Jul 1999 10:35:35 -0500 (CDT) Original-Received: from newman.aventail.com (root@newman.aventail.com [216.207.80.1]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id LAA02075 for ; Wed, 14 Jul 1999 11:34:27 -0400 (EDT) Original-Received: from leo.in.aventail.com (leo.in.aventail.com [192.168.1.136]) by newman.aventail.com (8.8.5/8.8.5) with ESMTP id IAA02043; Wed, 14 Jul 1999 08:34:22 -0700 (PDT) Original-Received: from megalith.bp.aventail.com (megalith.in.aventail.com [192.168.100.100]) by leo.in.aventail.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id M00KVKG1; Wed, 14 Jul 1999 08:29:25 -0700 Original-Received: (from wmperry@localhost) by megalith.bp.aventail.com (8.9.3/8.8.7) id IAA24988; Wed, 14 Jul 1999 08:35:01 -0500 Original-To: Lee Willis X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7 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.