Gnus development mailing list
 help / color / mirror / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
Subject: Re: MIME vs HTML
Date: 27 Nov 1998 13:17:18 +0100	[thread overview]
Message-ID: <m3iug1nxdd.fsf@sparky.gnus.org> (raw)
In-Reply-To: wmperry@aventail.com's message of "25 Nov 1998 19:26:39 -0500"

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.  :-)

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

<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>

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

<STYLE>
<!--
body {
margin-left: 4em;
color: "#427D64";
font-size: 12pt;
font-weight: regular;
font-family: "Arial";
}
-->
</STYLE>

isn't parsed, but perhaps it shouldn't be?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


  reply	other threads:[~1998-11-27 12:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-25 20:56 Lars Magne Ingebrigtsen
1998-11-26  0:26 ` William M. Perry
1998-11-27 12:17   ` Lars Magne Ingebrigtsen [this message]
1998-11-29  0:47     ` William M. Perry
1998-11-29 15:06       ` Lars Magne Ingebrigtsen
1998-11-29 17:32         ` William M. Perry
1998-11-29 18:24           ` Lars Magne Ingebrigtsen
1998-11-30 22:03             ` William M. Perry
1998-12-01  0:01               ` Lars Magne Ingebrigtsen
1998-11-29 18:53           ` Lars Magne Ingebrigtsen
1998-11-30 22:09             ` William M. Perry
1998-12-01  0:13               ` Lars Magne Ingebrigtsen
1998-11-29  5:11     ` William M. Perry
1998-12-02 19:27     ` Joe Wells
1998-12-02 21:41       ` Hrvoje Niksic

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=m3iug1nxdd.fsf@sparky.gnus.org \
    --to=larsi@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).