Function: mailcap-parse-mimetypes

mailcap-parse-mimetypes is an interactive and byte-compiled function defined in mailcap.el.gz.

Signature

(mailcap-parse-mimetypes &optional PATH FORCE)

Documentation

Parse out all the mimetypes specified in a Unix-style path string PATH.

Components of PATH are separated by the path-separator(var)/path-separator(fun) character appropriate for this system. If PATH is omitted, use the value of environment variable MIMETYPES if set; otherwise use a default path. If FORCE, re-parse even if already parsed.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/net/mailcap.el.gz
(defun mailcap-parse-mimetypes (&optional path force)
  "Parse out all the mimetypes specified in a Unix-style path string PATH.
Components of PATH are separated by the `path-separator' character
appropriate for this system.  If PATH is omitted, use the value of
environment variable MIMETYPES if set; otherwise use a default path.
If FORCE, re-parse even if already parsed."
  (interactive (list nil t))
  (when (or (not mailcap-mimetypes-parsed-p)
	    force)
    (cond
     (path nil)
     ((getenv "MIMETYPES") (setq path (getenv "MIMETYPES")))
     ((memq system-type mailcap-poor-system-types)
      (setq path '("~/mime.typ" "~/etc/mime.typ")))
     (t (setq path
	      ;; mime.types seems to be the normal name, definitely so
	      ;; on current GNUish systems.  The search order follows
	      ;; that for mailcap.
	      '("~/.mime.types"
		"/etc/mime.types"
		"/usr/etc/mime.types"
		"/usr/local/etc/mime.types"
		"/usr/local/www/conf/mime.types"
		"~/.mime-types"
		"/etc/mime-types"
		"/usr/etc/mime-types"
		"/usr/local/etc/mime-types"
		"/usr/local/www/conf/mime-types"))))
    (dolist (fname (reverse (if (stringp path)
                                (split-string path path-separator t)
                              path)))
      (when (file-readable-p fname)
        (mailcap-parse-mimetype-file fname)))
    (setq mailcap-mimetypes-parsed-p t)))