2 ;;; tm-html.el: a tm-view internal decoder for HTML
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1995,1996 MORIOKA Tomohiko
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;;; based on tm-latex.el by OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
11 ;;; $Id: tm-html.el,v 7.6 1996/05/27 08:00:50 morioka Exp $
12 ;;; Keywords: mail, news, MIME, multimedia, HTML, WWW
14 ;;; This file is part of tm (Tools for MIME).
16 ;;; This program is free software; you can redistribute it and/or
17 ;;; modify it under the terms of the GNU General Public License as
18 ;;; published by the Free Software Foundation; either version 2, or
19 ;;; (at your option) any later version.
21 ;;; This program is distributed in the hope that it will be useful,
22 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 ;;; General Public License for more details.
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with This program. If not, write to the Free Software
28 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
34 (defun mime-article/decode-html (beg end cal)
35 (let* ((cur-buf (current-buffer))
37 (name (or (cdr (assoc "name" cal))
38 (cdr (assoc "x-name" cal))
39 (concat (make-temp-name "tm") ".html")))
40 (encoding (cdr (assq 'encoding cal)))
41 ;; modified by Shuhei KOBAYASHI <shuhei@cmpt01.phys.tohoku.ac.jp>
42 ;; 1995/11/17 (cf. [tm-ja:1117])
43 (html-helper-build-new-buffer nil)
45 (switch-to-buffer mime::article/preview-buffer)
46 (funcall mime/find-file-function (expand-file-name name mime/tmp-dir))
47 (if (or (<= (buffer-size) 0)
48 (y-or-n-p "Replace the existing buffer?"))
51 (setq new-buf (current-buffer))
55 (re-search-forward "^$")
56 (append-to-buffer new-buf (+ (match-end 0) 1) end)
58 (mime-decode-region (point-min)(point-max) encoding)
59 (run-hooks 'mime-article/decode-html-hook)
62 (set-atype 'mime/content-decoding-condition
63 '((type . "text/html")
64 (method . mime-article/decode-html)