(mime-acting-condition): Rename `mime-display-caesar' ->
[elisp/semi.git] / mime-file.el
index fa2e692..a2de8d9 100644 (file)
@@ -1,13 +1,12 @@
 ;;; mime-file.el --- mime-view internal method for file extraction
 
-;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;; modified by Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
-;; Version: $Id: mime-file.el,v 0.2 1997-05-12 12:28:38 morioka Exp $
 ;; Keywords: file, extract, MIME, multimedia, mail, news
 
-;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
+;; This file is part of SEMI (Saver for Emacs MIME Interfaces).
 
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
@@ -28,7 +27,7 @@
 
 (require 'mime-view)
 
-(defun mime-article/extract-file (beg end cal)
+(defun mime-extract-current-entity (beg end cal)
   (goto-char beg)
   (let* ((name
          (save-restriction
              (lambda (file)
                (interactive "FFilename: ")
                (expand-file-name file))))))
-        (tmp-buf (generate-new-buffer (file-name-nondirectory filename)))
         )
     (if (file-exists-p filename)
         (or (yes-or-no-p (format "File %s exists. Save anyway? " filename))
             (error "")))
     (re-search-forward "\n\n")
-    (append-to-buffer tmp-buf (match-end 0) end)
-    (save-excursion
-      (set-buffer tmp-buf)
-      (mime-decode-region (point-min)(point-max) encoding)
-      (let ((coding-system-for-write 'no-conversion)
-           jka-compr-compression-info-list ; for jka-compr
-           jam-zcat-filename-list          ; for jam-zcat
-           require-final-newline)
-       (write-file filename)
-       )
-      (kill-buffer tmp-buf)
-      )))
+    (mime-write-decoded-region (match-end 0)(point-max) filename encoding)
+    ))
 
 
 ;;; @ setup
 
 (set-atype 'mime-acting-condition
           '((type . "application/octet-stream")
-            (method . mime-article/extract-file)
+            (method . mime-extract-current-entity)
             )
           'ignore '(method)
           'replacement)
 
 (set-atype 'mime-acting-condition
           '((mode . "extract")
-            (method . mime-article/extract-file)
+            (method . mime-extract-current-entity)
             )
           'remove
-          '((method "mime-file"  nil 'file 'type 'encoding 'mode 'name)
+          '((method "tm-file"  nil 'file 'type 'encoding 'mode 'name)
             (mode . "extract"))
           'replacement)