2 ;;; tm-rich.el --- text/enriched and text/richtext style
3 ;;; richtext filter for tm-view
5 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
6 ;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko
8 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
10 ;;; $Id: tm-rich.el,v 7.5 1996/05/07 06:28:36 morioka Exp $
11 ;;; Keywords: mail, news, MIME, multimedia, richtext, enriched
13 ;;; This file is part of tm (Tools for MIME).
15 ;;; This program is free software; you can redistribute it and/or
16 ;;; modify it under the terms of the GNU General Public License as
17 ;;; published by the Free Software Foundation; either version 2, or
18 ;;; (at your option) any later version.
20 ;;; This program is distributed in the hope that it will be useful,
21 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 ;;; General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with This program. If not, write to the Free Software
27 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
34 ;;; @ content filters for tm-view
37 (defun mime-viewer/filter-text/richtext (ctype params encoding)
38 (let* ((mode mime::preview/original-major-mode)
39 (m (assq mode mime-viewer/code-converter-alist))
40 (charset (assoc "charset" params))
41 ;; 1995/9/21 (c.f. tm-eng:105), 1995/10/3 (c.f. tm-eng:121)
42 ;; modified by Eric Ding <ericding@San-Jose.ate.slb.com>
43 (beg (point-min)) (end (point-max))
45 (remove-text-properties beg end '(face nil))
46 (mime/decode-region encoding beg end)
47 (if (and m (fboundp (setq m (cdr m))))
48 (funcall m beg (point-max) charset encoding)
49 (mime-viewer/default-code-convert-region beg (point-max)
52 (richtext-decode beg (point-max))
55 (defun mime-viewer/filter-text/enriched (ctype params encoding)
56 (let* ((mode mime::preview/original-major-mode)
57 (m (assq mode mime-viewer/code-converter-alist))
58 (charset (assoc "charset" params))
59 ;; 1995/9/21 (c.f. tm-eng:105), 1995/10/3 (c.f. tm-eng:121)
60 ;; modified by Eric Ding <ericding@San-Jose.ate.slb.com>
61 (beg (point-min)) (end (point-max))
63 (remove-text-properties beg end '(face nil))
64 (mime/decode-region encoding beg end)
65 (if (and m (fboundp (setq m (cdr m))))
66 (funcall m beg (point-max) charset encoding)
67 (mime-viewer/default-code-convert-region beg (point-max)
70 (enriched-decode beg (point-max))
77 (set-alist 'mime-viewer/content-filter-alist
78 "text/richtext" (function mime-viewer/filter-text/richtext))
80 (set-alist 'mime-viewer/content-filter-alist
81 "text/enriched" (function mime-viewer/filter-text/enriched))
89 (run-hooks 'tm-rich-load-hook)
91 ;;; tm-rich.el ends here