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.1 1995/11/16 15:43:34 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)))
21 (switch-to-buffer mime::article/preview-buffer)
22 (funcall mime/find-file-function (expand-file-name name mime/tmp-dir))
23 (if (or (<= (buffer-size) 0)
24 (y-or-n-p "Replace the existing buffer?"))
27 (setq new-buf (current-buffer))
31 (re-search-forward "^$")
32 (append-to-buffer new-buf (+ (match-end 0) 1) end)
34 (mime/decode-region encoding (point-min)(point-max))
35 (run-hooks 'mime-article/decode-html-hook)
38 (set-atype 'mime/content-decoding-condition
39 '((type . "text/html")
40 (method . mime-article/decode-html)