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.0 1995/12/12 00:55:25 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)
33 (let* ((name (or (cdr (assoc "name" cal))
34 (cdr (assoc "x-name" cal))))
35 (encoding (cdr (assq 'encoding cal)))
36 (file-coding-system *noconv*)
39 (expand-file-name name
43 (interactive "DDirectory: ")
48 (interactive "FFilename: ")
49 (expand-file-name file))))))
50 (the-buf (current-buffer))
51 (tmp-buf (generate-new-buffer (file-name-nondirectory filename)))
54 (re-search-forward "\n\n")
55 (append-to-buffer tmp-buf (match-end 0) end)
58 (mime/decode-region encoding (point-min)(point-max))
59 (let ((mc-flag nil) ; for Mule
61 (if (featurep 'mule) *noconv*))
62 kanji-flag ; for NEmacs
63 (emx-binary-mode t) ; for OS/2
64 jka-compr-compression-info-list ; for jka-compr
65 jam-zcat-filename-list ; for jam-zcat
66 require-final-newline)
76 (set-atype 'mime/content-decoding-condition
78 (method . mime-article/extract-file)
81 (set-atype 'mime/content-decoding-condition
82 '((type . "application/octet-stream")
83 (method . mime-article/extract-file)