Function: mailcap-add

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

Signature

(mailcap-add TYPE VIEWER &optional TEST)

Documentation

Add VIEWER as a handler for TYPE.

If TEST is not given, it defaults to t.

Source Code

;; Defined in /usr/src/emacs/lisp/net/mailcap.el.gz
(defun mailcap-add (type viewer &optional test)
  "Add VIEWER as a handler for TYPE.
If TEST is not given, it defaults to t."
  (let ((tl (split-string type "/")))
    (when (or (not (car tl))
	      (not (cadr tl)))
      (error "%s is not a valid MIME type" type))
    (let ((entry
           `((viewer . ,viewer)
             (test . ,(if test test t))
             (type . ,type))))
      ;; Store it.
      (mailcap-add-mailcap-entry (car tl) (cadr tl) entry
                                 'mailcap-user-mime-data)
      ;; Make it available for usage.
      (mailcap-add-mailcap-entry (car tl) (cadr tl) entry))))