From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/19278 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: 28 Nov 1998 19:47:00 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: <863e73jpff.fsf@kramer.bp.aventail.com> References: <86ogpvz4cg.fsf@kramer.bp.aventail.com> 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=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035157656 10785 80.91.224.250 (20 Oct 2002 23:47:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:47:36 +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 TAA03537 for ; Sat, 28 Nov 1998 19:47:31 -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 SAB04436; Sat, 28 Nov 1998 18:47:10 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 28 Nov 1998 18:47:01 -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 SAA14916 for ; Sat, 28 Nov 1998 18:46:50 -0600 (CST) Original-Received: from slow.bp.aventail.com (vina04.cntwk.net [207.205.120.130]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id TAA03522 for ; Sat, 28 Nov 1998 19:46:40 -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 TAA15254 for ; Sat, 28 Nov 1998 19:46:20 -0800 Original-Received: (from wmperry@localhost) by kramer.bp.aventail.com (8.8.5/8.8.5) id TAA12619; Sat, 28 Nov 1998 19:47:00 -0500 Original-To: ding@gnus.org X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7 writes: > wmperry@aventail.com (William M. Perry) writes: > > > 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. :-) Sweet! > 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)))))) This will be in the next version of Emacs/W3... gotta upgrade myself to pgnus soon I guess. :) > 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... Hmmm... sounds like the data is corrupt somehow (the glyph isn't being parsed correctly by XEmacs). > 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> fucking microsoft. '/' is not valid unless it is quoted there. Grrrr. I'll see what I can do for the next release. > Oh, and stuff like > > > > isn't parsed, but perhaps it shouldn't be? Where is it located? Head, body, etc? -Bill P.