Importing Pterodactyl Gnus v0.95.
[elisp/gnus.git-] / lisp / mailcap.el
index 9a4df73..7a1c05b 100644 (file)
       (viewer . mm-view-message)
       (test   . (and (featurep 'gnus)
                     (gnus-alive-p)))
-      (type   . "message/rfc-822"))
+      (type   . "message/rfc822"))
      ("rfc-*822"
       (viewer . vm-mode)
       (test   . (fboundp 'vm-mode))
-      (type   . "message/rfc-822"))
+      (type   . "message/rfc822"))
      ("rfc-*822"
       (viewer . w3-mode)
       (test   . (fboundp 'w3-mode))
-      (type   . "message/rfc-822"))
+      (type   . "message/rfc822"))
      ("rfc-*822"
       (viewer . view-mode)
       (test   . (fboundp 'view-mode))
-      (type   . "message/rfc-822"))
+      (type   . "message/rfc822"))
      ("rfc-*822"
       (viewer . fundamental-mode)
-      (type   . "message/rfc-822")))
+      (type   . "message/rfc822")))
     ("image"
      ("x-xwd"
       (viewer  . "xwud -in %s")
       (viewer . "ee %s")
       (type . "image/*")
       (test   . (eq (mm-device-type) 'x))
-      ("needsx11"))
-     (".*"
-      (viewer . "xv -perfect %s")
-      (type . "image/*")
-      (test   . (eq (mm-device-type) 'x))
       ("needsx11")))
     ("text"
      ("plain"
@@ -381,7 +376,7 @@ If FORCE, re-parse even if already parsed."
              (cond
               ((eq ?* (or (char-after save-pos) 0)) ".*")
               ((= (point) save-pos) ".*")
-              (t (buffer-substring save-pos (point)))))
+              (t (regexp-quote (buffer-substring save-pos (point))))))
        (skip-chars-forward "; \t\n")
        ;;; Got the major/minor chunks, now for the viewers/etc
        ;;; The first item _must_ be a viewer, according to the
@@ -389,6 +384,11 @@ If FORCE, re-parse even if already parsed."
        (skip-chars-forward "; \t\n")
        (setq save-pos (point))
        (skip-chars-forward "^;\n")
+       ;;; skip \;
+       (while (eq (char-before) ?\\)
+         (backward-delete-char 1)
+         (skip-chars-forward ";")
+         (skip-chars-forward "^;\n"))
        (if (eq (or (char-after save-pos) 0) ?')
            (setq viewer (progn
                           (narrow-to-region (1+ save-pos) (point))
@@ -424,14 +424,13 @@ If FORCE, re-parse even if already parsed."
       (skip-chars-forward " \n\t;")
       (while (not (eobp))
        (setq done nil)
-       (skip-chars-forward " \";\n\t")
        (setq name-pos (point))
-       (skip-chars-forward "^ \n\t=")
+       (skip-chars-forward "^ \n\t=;")
        (downcase-region name-pos (point))
        (setq name (buffer-substring name-pos (point)))
        (skip-chars-forward " \t\n")
        (if (not (eq (char-after (point)) ?=)) ; There is no value
-           (setq value nil)
+           (setq value t)
          (skip-chars-forward " \t\n=")
          (setq val-pos (point))
          (if (memq (char-after val-pos) '(?\" ?'))
@@ -450,7 +449,8 @@ If FORCE, re-parse even if already parsed."
                    (skip-chars-forward ";"))
                (setq done t))))
          (setq value (buffer-substring val-pos (point))))
-       (setq results (cons (cons name value) results)))
+       (setq results (cons (cons name value) results))
+       (skip-chars-forward " \";\n\t"))
       results)))
 
 (defun mailcap-mailcap-entry-passes-test (info)
@@ -461,6 +461,7 @@ If FORCE, re-parse even if already parsed."
        )
     (setq status (and test (split-string (cdr test) " ")))
     (if (and (or (assoc "needsterm" info)
+                (assoc "needsterminal" info)
                 (assoc "needsx11" info))
             (not (getenv "DISPLAY")))
        (setq status nil)
@@ -745,7 +746,7 @@ this type is returned."
     (".nc"       . "application/x-netcdf")
     (".nc"       . "application/x-netcdf")
     (".oda"      . "application/oda")
-    (".patch"    . "application/x-patch")
+    (".patch"    . "text/x-patch")
     (".pbm"      . "image/x-portable-bitmap")
     (".pdf"      . "application/pdf")
     (".pgm"      . "image/portable-graymap")
@@ -877,6 +878,10 @@ The path of COMMAND will be returned iff COMMAND is a command."
                       (not (file-directory-p file)))
              (throw 'found file))))))))
 
+(defun mailcap-mime-types ()
+  "Return a list of MIME media types."
+  (delete-duplicates (mapcar 'cdr mailcap-mime-extensions)))
+
 (provide 'mailcap)
 
 ;;; mailcap.el ends here