Gnus development mailing list
 help / color / mirror / Atom feed
From: Hrvoje Niksic <hniksic@srce.hr>
Subject: OK, so how do I *use* MIME?
Date: 12 Jan 1999 17:34:08 +0100	[thread overview]
Message-ID: <kigzp7oh2m7.fsf@jagor.srce.hr> (raw)

So now we have MIME handling in Gnus, and it should be possible to
program handling of new data types.  To take an example, I am
receiving patches in an ugly `application/x-gzip64' attachment, which
I want decoded by Gnus (please don't explain how broken that format is 
-- it's only an example.)

So I tried this in .gnus:

    (eval-after-load "mm-decode"
      '(progn
	 (push '("application/x-gunzip" inline-gunzip t)
	       mm-inline-media-tests)
	 (push '("application/x-gunzip" . inline) mm-user-display-methods)))

    (defun inline-gunzip (handle)
      (let ((b (point))
	    (text (mm-get-part handle)))
	(insert text)
	(save-restriction
	  (narrow-to-region b (point))
	  (call-process-region (point-min) (point-max) "gunzip" t t nil)
	  (mm-handle-set-undisplayer
	   handle
	   `(lambda ()
	      (let (buffer-read-only)
		(delete-region ,(point-min-marker) ,(point-max-marker))))))))

And indeed, it is fine, with two exceptions:

1) It does allow me to view the article in the buffer, but saving it
   or piping it to a command still saves the original junk, instead of 
   the decoded stuff.  Is there a way to hook into the way *contents*
   are handled, in order to allow easy saving of the junk?

2) Hooking into `mm-inline-media-tests' and `mm-user-display-methods'
   seems unclean, given that these variables are all but undocumented
   (hi Lloyd!).  How about having a variable for "user" handles, which 
   would be easy to access and modify?


             reply	other threads:[~1999-01-12 16:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-12 16:34 Hrvoje Niksic [this message]
1999-01-13 18:33 ` Lars Magne Ingebrigtsen
1999-01-13 22:39   ` Hrvoje Niksic
1999-01-13 23:26     ` Lars Magne Ingebrigtsen
1999-01-14 10:09       ` Kai.Grossjohann
1999-01-14 10:26         ` William M. Perry
1999-01-14 16:17       ` Hrvoje Niksic
1999-01-14 19:17         ` Lars Magne Ingebrigtsen
1999-01-14 23:29           ` Hrvoje Niksic
1999-01-15  0:17             ` Lars Magne Ingebrigtsen
1999-01-15  1:22               ` Hrvoje Niksic
1999-01-15 15:15                 ` Lars Magne Ingebrigtsen
1999-01-15  2:29               ` lconrad
1999-01-15 15:16                 ` Lars Magne Ingebrigtsen
1999-01-15  9:11               ` Steinar Bang
1999-01-15 15:16                 ` Lars Magne Ingebrigtsen
1999-01-15 18:26                 ` Graham Murray
1999-01-15 15:43           ` Andrew Hobson
1999-01-15 16:03             ` Lars Magne Ingebrigtsen
1999-01-14  0:36     ` William M. Perry
1999-01-14 15:36       ` Jari Aalto+list.ding
1999-01-14 16:01         ` William M. Perry
1999-01-14 16:11           ` Richard Coleman

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=kigzp7oh2m7.fsf@jagor.srce.hr \
    --to=hniksic@srce.hr \
    /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).