1 ;;; mime-file.el --- mime-view internal method for file extraction
3 ;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; modified by Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
7 ;; Keywords: file, extract, MIME, multimedia, mail, news
9 ;; This file is part of SEMI (Saver for Emacs MIME Interfaces).
11 ;; This program is free software; you can redistribute it and/or
12 ;; modify it under the terms of the GNU General Public License as
13 ;; published by the Free Software Foundation; either version 2, or (at
14 ;; your option) any later version.
16 ;; This program is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ;; General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
30 (defun mime-extract-current-entity (beg end cal)
34 (narrow-to-region beg end)
35 (mime-article/get-filename cal)
37 (encoding (cdr (assq 'encoding cal)))
39 (if (and name (not (string-equal name "")))
40 (expand-file-name name
44 (interactive "DDirectory: ")
49 (interactive "FFilename: ")
50 (expand-file-name file))))))
52 (if (file-exists-p filename)
53 (or (yes-or-no-p (format "File %s exists. Save anyway? " filename))
55 (re-search-forward "\n\n")
56 (mime-write-decoded-region (match-end 0)(point-max) filename encoding)
63 (set-atype 'mime-acting-condition
64 '((type . "application/octet-stream")
65 (method . mime-extract-current-entity)
70 (set-atype 'mime-acting-condition
72 (method . mime-extract-current-entity)
75 '((method "tm-file" nil 'file 'type 'encoding 'mode 'name)
85 ;;; end of mime-file.el