update.
[elisp/semi.git] / mime-play.el
index 0ccb3ed..41f7fca 100644 (file)
@@ -30,6 +30,8 @@
 (require 'alist)
 (require 'filename)
 
+(eval-when-compile (require 'mime-text))
+
   
 ;;; @ content decoder
 ;;;
@@ -98,7 +100,8 @@ specified, play as it.  Default MODE is \"play\"."
             )
            (t
             (mime-show-echo-buffer
-             "No method are specified for %s\n" ctype)
+             "No method are specified for %s\n"
+             (mime-type/subtype-string c-type c-subtype))
             ))
       )
     ))
@@ -263,7 +266,7 @@ window.")
            (narrow-to-region beg end)
            (mime-raw-get-filename cal)
            ))
-        (encoding (cdr (assq 'encoding cal)))
+        (encoding (or (cdr (assq 'encoding cal)) "7bit"))
         (filename
           (if (and name (not (string-equal name "")))
              (expand-file-name name
@@ -282,7 +285,7 @@ window.")
         (or (yes-or-no-p (format "File %s exists. Save anyway? " filename))
             (error "")))
     (re-search-forward "\n\n")
-    (mime-write-decoded-region (match-end 0)(point-max) filename encoding)
+    (mime-write-decoded-region (match-end 0) end filename encoding)
     ))
 
 
@@ -326,21 +329,16 @@ It is registered to variable `mime-preview-quitting-method-alist'."
 ;;; @ message/partial
 ;;;
 
-(defvar mime-raw-coding-system-alist
-  `((mh-show-mode . no-conversion)
-    (t . ,(mime-charset-to-coding-system default-mime-charset)))
-  "Alist of major-mode vs. corresponding coding-system.")
-
 (defun mime-raw-write-region (start end filename)
   "Write current region into specified file.
 When called from a program, takes three arguments:
 START, END and FILENAME.  START and END are buffer positions.
-It refer `mime-raw-coding-system-alist' to choose coding-system to
-write."
+It refer `mime-raw-buffer-coding-system-alist' to choose coding-system
+to write."
   (let ((coding-system-for-write
         (cdr
-         (or (assq major-mode mime-raw-coding-system-alist)
-             (assq t mime-raw-coding-system-alist)
+         (or (assq major-mode mime-raw-buffer-coding-system-alist)
+             (assq t mime-raw-buffer-coding-system-alist)
              ))))
     (write-region start end filename)
     ))