2 ;;; tm-file.el --- tm-view internal method for file extraction
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1995 MORIOKA Tomohiko
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;;; $Id: tm-file.el,v 7.2 1995/12/21 18:08:22 morioka Exp $
10 ;;; Keywords: mail, news, MIME, multimedia
12 ;;; This file is part of tm (Tools for MIME).
14 ;;; This program is free software; you can redistribute it and/or
15 ;;; modify it under the terms of the GNU General Public License as
16 ;;; published by the Free Software Foundation; either version 2, or
17 ;;; (at your option) any later version.
19 ;;; This program is distributed in the hope that it will be useful,
20 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 ;;; General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with This program. If not, write to the Free Software
26 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
32 (defun mime-article/extract-file (beg end cal)
36 (narrow-to-region beg end)
37 (mime-article/get-filename cal)
39 (encoding (cdr (assq 'encoding cal)))
42 (expand-file-name name
46 (interactive "DDirectory: ")
51 (interactive "FFilename: ")
52 (expand-file-name file))))))
53 (the-buf (current-buffer))
54 (tmp-buf (generate-new-buffer (file-name-nondirectory filename)))
56 (re-search-forward "\n\n")
57 (append-to-buffer tmp-buf (match-end 0) end)
60 (mime/decode-region encoding (point-min)(point-max))
61 (let ((mc-flag nil) ; for Mule
63 (if (featurep 'mule) *noconv*))
64 kanji-flag ; for NEmacs
65 (emx-binary-mode t) ; for OS/2
66 jka-compr-compression-info-list ; for jka-compr
67 jam-zcat-filename-list ; for jam-zcat
68 require-final-newline)
78 (set-atype 'mime/content-decoding-condition
80 (method . mime-article/extract-file)
83 (set-atype 'mime/content-decoding-condition
84 '((type . "application/octet-stream")
85 (method . mime-article/extract-file)