(mime-file-content-type-alist): Add "Standard MIDI".
[elisp/semi.git] / mime-play.el
index 344b9da..b163641 100644 (file)
@@ -206,13 +206,12 @@ specified, play as it.  Default MODE is \"play\"."
        (let ((method (cdr (assoc 'method situation)))
              (name (mime-entity-safe-filename entity)))
          (setq name
-               (if name
+               (if (and name (not (string= name "")))
                    (expand-file-name name mime-temp-directory)
                  (make-temp-name
                   (expand-file-name "EMI" mime-temp-directory))
                  ))
-         (mime-write-decoded-region (mime-entity-body-start entity) end
-                                    name (cdr (assq 'encoding situation)))
+          (mime-write-entity-content entity name)
          (message "External method is starting...")
          (let ((process
                 (let ((command
@@ -339,8 +338,9 @@ window.")
 ;;;
 
 (defvar mime-file-content-type-alist
-  '(("JPEG"    image jpeg)
-    ("GIF"     image gif)
+  '(("JPEG"            image jpeg)
+    ("GIF"             image gif)
+    ("Standard MIDI"   audio midi)
     )
   "*Alist of \"file\" output patterns vs. corresponding media-types.
 Each element looks like (REGEXP TYPE SUBTYPE).
@@ -370,10 +370,12 @@ SUBTYPE is symbol to indicate subtype of media-type.")
          (if (search-forward (concat filename ": ") nil t)
              (let ((rest mime-file-content-type-alist))
                (while (not (let ((cell (car rest)))
-                             (if (looking-at (car cell))
-                                 (setq type (nth 1 cell)
-                                       subtype (nth 2 cell))
-                               )))
+                             (if cell
+                                 (if (looking-at (car cell))
+                                     (setq type (nth 1 cell)
+                                           subtype (nth 2 cell))
+                                   )
+                               t)))
                  (setq rest (cdr rest))))))
        (if type
            (mime-raw-play-entity