1 ;;; mime-w3.el --- mime-view content filter for text
3 ;; Copyright (C) 1994,1995,1996,1997,1998 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Keywords: HTML, MIME, multimedia, mail, news
8 ;; This file is part of SEMI (Suite of Emacs MIME Interfaces).
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or (at
13 ;; your option) any later version.
15 ;; This program is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
30 (defmacro mime-put-keymap-region (start end keymap)
31 `(put-text-property ,start ,end
32 ',(if (featurep 'xemacs)
38 (defmacro mime-save-background-color (&rest body)
39 (if (featurep 'xemacs)
40 `(let ((color (color-name (face-background 'default))))
43 (font-set-face-background 'default color (current-buffer))
47 (defun mime-preview-text/html (entity situation)
48 (mime-save-background-color
50 (narrow-to-region (point-max)(point-max))
51 (mime-text-insert-decoded-body entity)
52 (let ((beg (point-min)))
53 (remove-text-properties beg (point-max) '(face nil))
54 (w3-region beg (point-max))
55 (mime-put-keymap-region beg (point-max) w3-mode-map)
64 ;;; mime-w3.el ends here