2 ;;; tm-html.el: a tm-view internal decoder for HTML
4 ;;; by MORIOKA Tomohiko <morioka@jaist.ac.jp> (1995/09/14)
6 ;;; based on tm-latex.el by OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
8 ;;; $Id: tm-html.el,v 7.3 1995/12/04 00:20:31 morioka Exp $
13 (defun mime-article/decode-html (beg end cal)
14 (let* ((cur-buf (current-buffer))
16 (name (or (cdr (assoc "name" cal))
17 (cdr (assoc "x-name" cal))
18 (concat (make-temp-name "tm") ".html")))
19 (encoding (cdr (assoc "encoding" cal)))
20 ;; modified by Shuhei KOBAYASHI <shuhei@cmpt01.phys.tohoku.ac.jp>
21 ;; 1995/11/17 (cf. [tm-ja:1117])
22 (html-helper-build-new-buffer nil)
24 (switch-to-buffer mime::article/preview-buffer)
25 (funcall mime/find-file-function (expand-file-name name mime/tmp-dir))
26 (if (or (<= (buffer-size) 0)
27 (y-or-n-p "Replace the existing buffer?"))
30 (setq new-buf (current-buffer))
34 (re-search-forward "^$")
35 (append-to-buffer new-buf (+ (match-end 0) 1) end)
37 (mime/decode-region encoding (point-min)(point-max))
38 (run-hooks 'mime-article/decode-html-hook)
41 (set-atype 'mime/content-decoding-condition
42 '((type . "text/html")
43 (method . mime-article/decode-html)