From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/19220 Path: main.gmane.org!not-for-mail From: wmperry@aventail.com (William M. Perry) Newsgroups: gmane.emacs.gnus.general Subject: Re: MIME vs HTML Date: 25 Nov 1998 19:26:39 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: <86ogpvz4cg.fsf@kramer.bp.aventail.com> References: Reply-To: wmperry@aventail.com NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1035157609 10481 80.91.224.250 (20 Oct 2002 23:46:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:46:49 +0000 (UTC) Cc: ding@gnus.org Return-Path: Original-Received: from karazm.math.uh.edu (karazm.math.uh.edu [129.7.128.1]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id TAA11475 for ; Wed, 25 Nov 1998 19:27:43 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by karazm.math.uh.edu (8.9.1/8.9.1) with ESMTP id SAB02938; Wed, 25 Nov 1998 18:27:21 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 25 Nov 1998 18:27:20 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id SAA10865 for ; Wed, 25 Nov 1998 18:27:07 -0600 (CST) Original-Received: from slow.bp.aventail.com (vind01.cntwk.net [207.205.120.175]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id TAA11340 for ; Wed, 25 Nov 1998 19:26:59 -0500 (EST) Original-Received: from kramer.bp.aventail.com (kramer.bp.aventail.com [192.168.2.2]) by slow.bp.aventail.com (8.8.5/8.8.5) with ESMTP id TAA00461; Wed, 25 Nov 1998 19:25:28 -0800 Original-Received: (from wmperry@localhost) by kramer.bp.aventail.com (8.8.5/8.8.5) id TAA00522; Wed, 25 Nov 1998 19:26:39 -0500 Original-To: Lars Magne Ingebrigtsen X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7 writes: > Aha! Now I know how Microsofties do MIME properly -- they don't. > Instead they do HTML with > > There's nothing wrong with this. Perfectly reasonable given the age of the CID URL draft. :) I actually sent you email about how we could make this easy for Emacs/W3 to support. :) > tags inside, which allows an entire document consisting of many parts to > be rendered. Which makes sense. > > If Gnus is to render this properly, I guess Gnus will have to transform > these so that w3 can pick up the images properly... (Gnus will have to > stop rendering the HTML in one window and copying it over, though, since > images don't survive that very well. William -- any comments?) If GNUs can bind a variable or provide a function that would allow a 'cid' URL handler in Emacs/W3 to get the part and header information associated with a content-id, I could just do: (url-register-protocol 'cid nil 'url-identity-expander) (defun gnus-mime-get-part-by-content-id (cid) "Returns a MIME part given it's content-id." . . . ) (defun gnus-part-content-type (part) "Returns the content-type of a MIME part" . . . ) (defun gnus-part-content-encoding (part) "Returns the content-encoding of a MIME part" . . . ) (defun url-cid (url) (set-buffer (get-buffer-create url-working-buffer)) (let ((content-type nil) (encoding nil) (part nil) (data nil)) (if (not (string-match "^cid:\\(.*\\)" url)) (message "Malformed CID URL: %s" url) (setq url (url-unhex-string (match-string 1 url)) part (gnus-mime-get-part-by-content-id url)) (if (not part) (message "Unknown CID encounterred: %s" url) (setq data (gnus-part-body part) content-type (gnus-part-content-type part) encoding (gnus-part-content-encoding part)) (if (= 0 (length content-type)) (setq content-type "text/plain")) (if (= 0 (length encoding)) (setq encoding "8bit")) (setq url-current-content-length (length data) url-current-mime-type content-type url-current-mime-encoding encoding url-current-mime-headers (list (cons "content-type" content-type) (cons "content-encoding" encoding))) (and data (insert data)))))) And voila! -Bill P.