;;; mm-decode.el --- Functions for decoding MIME things
-;; Copyright (C) 1998-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2012 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
(require 'mail-parse)
(require 'mm-bodies)
+(require 'mm-archive)
(eval-when-compile (require 'cl)
(require 'term))
("image/tiff"
mm-inline-image
(lambda (handle)
- (mm-valid-and-fit-image-p 'tiff handle)) )
+ (mm-valid-and-fit-image-p 'tiff handle)))
("image/xbm"
mm-inline-image
(lambda (handle)
("multipart/alternative" ignore identity)
("multipart/mixed" ignore identity)
("multipart/related" ignore identity)
+ ("image/.*"
+ mm-inline-image
+ (lambda (handle)
+ (and (mm-valid-image-format-p 'imagemagick)
+ (mm-with-unibyte-buffer
+ (mm-insert-part handle)
+ (let ((image
+ (ignore-errors
+ (if (fboundp 'create-image)
+ (create-image (buffer-string) 'imagemagick 'data-p)
+ (mm-create-image-xemacs (mm-handle-media-subtype handle))))))
+ (when image
+ (setcar (cdr handle) (list "image/imagemagick"))
+ (mm-image-fit-p handle)))))))
;; Disable audio and image
("audio/.*" ignore ignore)
("image/.*" ignore ignore)
(\"text/html\" \"text/richtext\")
Adding \"image/.*\" might also be useful. Spammers use it as the
-prefered part of multipart/alternative messages. See also
+preferred part of multipart/alternative messages. See also
`gnus-buttonized-mime-types', to which adding \"multipart/alternative\"
enables you to choose manually one of two types those mails include."
:type '(repeat regexp) ;; See `mm-preferred-alternative-precedence'.
(if (equal "text/plain" (car ctl))
(assoc 'format ctl)
t))
- (mm-make-handle
- (mm-copy-to-buffer) ctl cte nil cdl description nil id)))
+ (let ((handle
+ (mm-make-handle
+ (mm-copy-to-buffer) ctl cte nil cdl description nil id)))
+ (if (member (car ctl) mm-archive-decoders)
+ (mm-dissect-archive handle)
+ handle))))
(defun mm-dissect-multipart (ctl from)
(goto-char (point-min))
;; In particular, the timer object (which is
;; a vector in Emacs but is a list in XEmacs)
;; requires that it is lexically scoped.
- (timer (run-at-time 2.0 nil 'ignore)))
+ (timer (run-at-time 30.0 nil 'ignore)))
(if (featurep 'xemacs)
(lambda (process state)
(when (eq 'exit (process-status process))
(mailcap-mime-info type 'all)))
(method (let ((minibuffer-local-completion-map
mm-viewer-completion-map))
- (gnus-completing-read "Viewer" methods))))
+ (completing-read "Viewer: " methods))))
(when (string= method "")
(error "No method given"))
(if (string-match "^[^% \t]+$" method)
(or (not image)
(if (featurep 'xemacs)
;; XEmacs' glyphs can actually tell us about their width, so
- ;; lets be nice and smart about them.
+ ;; let's be nice and smart about them.
(or mm-inline-large-images
(and (<= (glyph-width image) (window-pixel-width))
(<= (glyph-height image) (window-pixel-height))))
(buffer-string))))))
shr-inhibit-images shr-blocked-images charset char)
(if (and (boundp 'gnus-summary-buffer)
+ (bufferp gnus-summary-buffer)
(buffer-name gnus-summary-buffer))
(with-current-buffer gnus-summary-buffer
(setq shr-inhibit-images gnus-inhibit-images