2 ;;; tm-w3.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-w3.el,v 3.0 1995/10/20 10:42:41 morioka Exp $
13 (autoload 'w3-mode "w3" "HTML viewer" t)
15 (defvar mime-viewer/html-default-mode (function w3-mode))
17 (defun mime-viewer/decode-html (beg end cal)
18 (let* ((cur-buf (current-buffer))
20 (name (or (cdr (assoc "name" cal))
21 (cdr (assoc "x-name" cal))
22 (concat (make-temp-name "tm") ".html"))))
23 (switch-to-buffer mime::article/preview-buffer)
24 (funcall mime/find-file-function (expand-file-name name mime/tmp-dir))
25 (if (or (<= (buffer-size) 0)
26 (y-or-n-p "Replace the existing buffer?"))
29 (setq new-buf (current-buffer))
33 (re-search-forward "^$")
34 (append-to-buffer new-buf (+ (match-end 0) 1) end)
36 (mime/decode-region encoding (point-min)(point-max))
37 (call-interactively mime-viewer/html-default-mode)
40 (set-atype 'mime/content-decoding-condition
41 '((type . "text/html")
42 (method . mime-viewer/decode-html)