From: wmperry@aventail.com (William M. Perry)
Cc: ding@gnus.org
Subject: Re: MIME vs HTML
Date: 25 Nov 1998 19:26:39 -0500 [thread overview]
Message-ID: <86ogpvz4cg.fsf@kramer.bp.aventail.com> (raw)
In-Reply-To: Lars Magne Ingebrigtsen's message of "25 Nov 1998 21:56:53 +0100"
Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:
> Aha! Now I know how Microsofties do MIME properly -- they don't.
> Instead they do HTML with
>
> <img src="cid:003e01be1642$a526f940$b86efea9@win">
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.
next prev parent reply other threads:[~1998-11-26 0:26 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 [this message]
1998-11-27 12:17 ` Lars Magne Ingebrigtsen
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=86ogpvz4cg.fsf@kramer.bp.aventail.com \
--to=wmperry@aventail.com \
--cc=ding@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).