Gnus development mailing list
 help / color / mirror / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
Subject: Re: Adding MIME viewers
Date: 25 Sep 1999 10:59:41 +0200	[thread overview]
Message-ID: <m33dw374ea.fsf@quimbies.gnus.org> (raw)
In-Reply-To: Toby Speight's message of "10 Sep 1999 10:48:46 +0100"

Toby Speight <Toby.Speight@streapadair.freeserve.co.uk> writes:

> Has anyone written a good guide for writing viewers for MIME-types
> not built-in to Gnus?  In particular, I've recently installed Stefan
> Monnier's diff-mode.el, and I'd like to use his font-lock rules to
> fontify "text/x-patch" bodyparts.

I've now added the following section to the Emacs-MIME manual:

New Viewers
===========

   Here's an example viewer for displaying `text/enriched' inline:

     (defun mm-display-enriched-inline (handle)
       (with-temp-buffer
         (mm-insert-part handle)
         (save-window-excursion
           (enriched-decode (point-min) (point-max))
           (setq text (buffer-string))))
       (mm-insert-inline handle text))

   We see that the function takes a MIME handle as its parameter.  It
then goes to a temporary buffer, inserts the text of the part, does some
work on the text, stores the result, goes back to the buffer it was
called from and inserts the result.

   The two important helper functions here are `mm-insert-part' and
`mm-insert-inline'.  The first function inserts the text of the handle
in the current buffer.  It handles charset and/or content transfer
decoding.  The second function just inserts whatever text you tell it
to insert, but it also sets things up so that the text can be
"undisplayed' in a convenient manner.


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


  reply	other threads:[~1999-09-25  8:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-10  9:48 Toby Speight
1999-09-25  8:59 ` Lars Magne Ingebrigtsen [this message]
1999-09-27 13:44   ` Toby Speight
1999-09-27 14:07     ` Lars Magne Ingebrigtsen
1999-10-04 12:06   ` Toby Speight
1999-10-09 14:20     ` Robert Bihlmeyer
1999-10-11  8:51       ` Hrvoje Niksic
1999-11-06  2:53     ` Lars Magne Ingebrigtsen

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=m33dw374ea.fsf@quimbies.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).