Gnus development mailing list
 help / color / mirror / Atom feed
* OK, so how do I *use* MIME?
@ 1999-01-12 16:34 Hrvoje Niksic
  1999-01-13 18:33 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 23+ messages in thread
From: Hrvoje Niksic @ 1999-01-12 16:34 UTC (permalink / 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?


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~1999-01-15 18:26 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-12 16:34 OK, so how do I *use* MIME? Hrvoje Niksic
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

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