Function: mailcap-view-mime

mailcap-view-mime is a byte-compiled function defined in mailcap.el.gz.

Signature

(mailcap-view-mime TYPE)

Documentation

View the data in the current buffer that has MIME type TYPE.

The variable mailcap--computed-mime-data determines the method to use. If the method is a shell command string, erase the current buffer after passing its contents to the shell command.

Source Code

;; Defined in /usr/src/emacs/lisp/net/mailcap.el.gz
(defun mailcap-view-mime (type)
  "View the data in the current buffer that has MIME type TYPE.
The variable `mailcap--computed-mime-data' determines the method
to use.  If the method is a shell command string, erase the
current buffer after passing its contents to the shell command."
  (let ((method (mailcap-mime-info type)))
    (if (stringp method)
        (let* ((ext (concat "." (cadr (split-string type "/"))))
               (file (make-temp-file "emacs-mailcap" nil ext))
               (coding-system-for-write 'binary))
          (write-region nil nil file nil 'silent)
          (delete-region (point-min) (point-max))
          (mailcap--async-shell method file))
      (funcall method))))