Synch with Gnus.
[elisp/gnus.git-] / lisp / gnus-mailcap.el
index 1c72d9f..4f5e19c 100644 (file)
@@ -357,7 +357,7 @@ MAILCAPS if set; otherwise (on Unix) use the path from RFC 1524, plus
                "/usr/local/etc/mailcap"))))
     (let ((fnames (reverse
                   (if (stringp path)
-                      (parse-colon-path path)
+                      (delete "" (split-string path path-separator))
                     path)))
          fname)
       (while fnames
@@ -526,7 +526,7 @@ MAILCAPS if set; otherwise (on Unix) use the path from RFC 1524, plus
       (cond
        ((equal (car (car major)) minor)
        (setq exact (cons (cdr (car major)) exact)))
-       ((and minor (string-match (car (car major)) minor))
+       ((and minor (string-match (concat "^" (car (car major)) "$") minor))
        (setq wildcard (cons (cdr (car major)) wildcard))))
       (setq major (cdr major)))
     (nconc exact wildcard)))
@@ -860,7 +860,7 @@ If FORCE, re-parse even if already parsed."
                "/usr/local/etc/mime-types"
                "/usr/local/www/conf/mime-types"))))
     (let ((fnames (reverse (if (stringp path)
-                              (parse-colon-path path)
+                              (delete "" (split-string path path-separator))
                             path)))
          fname)
       (while fnames
@@ -937,7 +937,23 @@ The path of COMMAND will be returned iff COMMAND is a command."
 (defun mailcap-mime-types ()
   "Return a list of MIME media types."
   (mailcap-parse-mimetypes)
-  (mm-delete-duplicates (mapcar 'cdr mailcap-mime-extensions)))
+  (mm-delete-duplicates
+   (nconc
+    (mapcar 'cdr mailcap-mime-extensions)
+    (apply
+     'nconc
+     (mapcar
+      (lambda (l)
+       (delq nil
+             (mapcar
+              (lambda (m)
+                (let ((type (cdr (assq 'type (cdr m)))))
+                  (if (equal (cadr (split-string type "/"))
+                             "*")
+                      nil
+                    type)))
+              (cdr l))))
+      mailcap-mime-data)))))
 
 (provide 'gnus-mailcap)