(defun gnus-mime-view-part-as-type-internal () (gnus-article-check-buffer) (let* ((name (mail-content-type-get (mm-handle-type (get-text-property (point) 'gnus-data)) 'name)) (def-type (and name (mm-default-file-encoding name)))) (and def-type (cons def-type 0)))) (defun gnus-mime-view-part-as-type (mime-type) "Choose a MIME media type, and view the part as such." (interactive (list (completing-read "View as MIME type: " (mapcar (lambda (i) (list i i)) (mailcap-mime-types)) nil nil (gnus-mime-view-part-as-type-internal)))) (gnus-article-check-buffer) (let* ((handle (get-text-property (point) 'gnus-data))) (gnus-mm-display-part (mm-make-handle (mm-handle-buffer handle) (cons mime-type (cdr (mm-handle-type handle))) (mm-handle-encoding handle) (mm-handle-undisplayer handle) (mm-handle-disposition handle) (mm-handle-description handle) (mm-handle-cache handle) (mm-handle-id handle)))))