;;;
;;; tm-html.el: a tm-view internal decoder for HTML
;;;
;;; by MORIOKA Tomohiko (1995/09/14)
;;;
;;; based on tm-latex.el by OKABE Yasuo
;;;
;;; $Id: tm-html.el,v 7.2 1995/11/17 13:11:36 morioka Exp $
;;;
(require 'tm-view)
(defun mime-article/decode-html (beg end cal)
(let* ((cur-buf (current-buffer))
new-buf
(name (or (cdr (assoc "name" cal))
(cdr (assoc "x-name" cal))
(concat (make-temp-name "tm") ".html")))
(encoding (cdr (assoc "encoding" cal)))
;; modified by Shuhei KOBAYASHI
;; 1995/11/17 (cf. [tm-ja:1117])
(html-helper-build-new-buffer nil)
)
(switch-to-buffer mime::article/preview-buffer)
(funcall mime/find-file-function (expand-file-name name mime/tmp-dir))
(if (or (<= (buffer-size) 0)
(y-or-n-p "Replace the existing buffer?"))
(progn
(erase-buffer)
(setq new-buf (current-buffer))
(save-excursion
(set-buffer cur-buf)
(goto-char beg)
(re-search-forward "^$")
(append-to-buffer new-buf (+ (match-end 0) 1) end)
)))
(mime/decode-region encoding (point-min)(point-max))
(run-hooks 'mime-article/decode-html-hook)
))
(set-atype 'mime/content-decoding-condition
'((type . "text/html")
(method . mime-article/decode-html)
))
;;; @ end
;;;
(provide 'tm-html)