From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/19261 Path: main.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.gnus.general Subject: Re: MIME vs HTML Date: 27 Nov 1998 13:17:18 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: <86ogpvz4cg.fsf@kramer.bp.aventail.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035157642 10697 80.91.224.250 (20 Oct 2002 23:47:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:47:22 +0000 (UTC) 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 HAA29358 for ; Fri, 27 Nov 1998 07:19:48 -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 GAB07582; Fri, 27 Nov 1998 06:18:59 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 27 Nov 1998 06:18:51 -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 GAA29371 for ; Fri, 27 Nov 1998 06:18:33 -0600 (CST) Original-Received: from sparky.gnus.org (ppp007.uio.no [129.240.240.8]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id HAA29324 for ; Fri, 27 Nov 1998 07:18:21 -0500 (EST) Original-Received: (from larsi@localhost) by sparky.gnus.org (8.8.7/8.8.7) id NAA25277; Fri, 27 Nov 1998 13:28:18 +0100 Mail-Copies-To: never X-Now-Reading: Greg Bear's _Slant_ X-Now-Playing: The Art of Noise's _In Visible Silence_ Original-To: ding@gnus.org In-Reply-To: wmperry@aventail.com's message of "25 Nov 1998 19:26:39 -0500" User-Agent: Gnus/5.070055 (Pterodactyl Gnus v0.55) XEmacs/21.2(beta3) (Aglaia) X-Face: &w!^oO~dS|}-P0~ge{$c!h\ I actually sent you email about how we could make > this easy for Emacs/W3 to support. :) Oops. I forgot all about that... > 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." > . > . > . > ) (etc). I added all of these, and then it turned out I had already written all these function. :-) The new version of url-cid is then: (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 (mm-get-content-id url)) (if (not part) (message "Unknown CID encounterred: %s" url) (setq data (buffer-string nil nil (mm-handle-buffer part)) content-type (mm-handle-type part) encoding (symbol-name (mm-handle-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 this function is called, and it seems to me that everything is inserted as it should and stuff. (After twiddling slightly with some other stuff.) However, w3 doesn't look like it wants to render the picture. Here's how Gnus displays the HTML: > Denne e-mail'en er skrevet i Outlook Express. Teksten her er grønn. I venstre > marg ligger det et bilde. Og her: [cid:003e01be1642$a526f940$b86efea9@win]har > jeg satt inn et annet bilde, med "baseline" alignment. So instead of the picture, w3 inserts a button... Anyway, while we're talking about w3: If there's a in the message, which is something Outlook Express seems to put into everything it sends out, w3 will render this thusly: html;charset=iso-8859-1 http-equiv=Content-Type> Which is rather odd. (This is with the w3 that comes with XEmacs 21.2 (Aglaia).) Oh, and stuff like isn't parsed, but perhaps it shouldn't be? -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen