Rename `mime-view-original-major-mode' ->
[elisp/semi.git] / mime-play.el
index 65b9fcf..0df9aec 100644 (file)
@@ -34,9 +34,9 @@
 ;;; @ content decoder
 ;;;
 
-(defvar mime-preview/after-decoded-position nil)
+(defvar mime-preview-after-decoded-position nil)
 
-(defun mime-view-play-current-entity (&optional mode)
+(defun mime-preview-play-current-entity (&optional mode)
   "Play current entity.
 It decodes current entity to call internal or external method.  The
 method is selected from variable `mime-acting-condition'.
@@ -50,23 +50,27 @@ If MODE is specified, play as it.  Default MODE is \"play\"."
        (let ((the-buf (current-buffer))
              (raw-buffer (get-text-property (point) 'mime-view-raw-buffer))
              )
-         (setq mime-preview/after-decoded-position (point))
+         (setq mime-preview-after-decoded-position (point))
          (set-buffer raw-buffer)
          (mime-playback-entity cinfo mode)
          (if (eq (current-buffer) raw-buffer)
              (progn
                (set-buffer the-buf)
-               (goto-char mime-preview/after-decoded-position)
+               (goto-char mime-preview-after-decoded-position)
                ))
          ))))
 
 (defun mime-playback-entity (cinfo &optional mode)
   (let ((beg (mime-entity-info-point-min cinfo))
        (end (mime-entity-info-point-max cinfo))
-       (ctype (or (mime-entity-info-type/subtype cinfo) "text/plain"))
+       (c-type (mime-entity-info-media-type cinfo))
+       (c-subtype (mime-entity-info-media-subtype cinfo))
        (params (mime-entity-info-parameters cinfo))
        (encoding (mime-entity-info-encoding cinfo))
        )
+    (or c-type
+       (setq c-type 'text
+             c-subtype 'plain))
     ;; Check for VM
     (if (< beg (point-min))
        (setq beg (point-min))
@@ -75,7 +79,8 @@ If MODE is specified, play as it.  Default MODE is \"play\"."
        (setq end (point-max))
       )
     (let (method cal ret)
-      (setq cal (list* (cons 'type ctype)
+      (setq cal (list* (cons 'type c-type)
+                      (cons 'subtype c-subtype)
                       (cons 'encoding encoding)
                       (cons 'major-mode major-mode)
                       params))
@@ -291,7 +296,7 @@ It is registered to variable `mime-view-quitting-method-alist'."
        (win-conf mime::preview/original-window-configuration)
        )
     (kill-buffer mime-raw-buffer)
-    (mime-view-kill-buffer)
+    (mime-preview-kill-buffer)
     (set-window-configuration win-conf)
     (pop-to-buffer mother)
     ))