1 ;;; mime-w3.el --- mime-view content filter for text
3 ;; Copyright (C) 1994,95,96,97,98,99,2000 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <tomo@m17n.org>
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., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
32 (defmacro mime-put-keymap-region (start end keymap)
33 `(put-text-property ,start ,end
34 ',(if (featurep 'xemacs)
39 (defmacro mime-save-background-color (&rest body)
40 (if (featurep 'xemacs)
41 `(let ((color (color-name (face-background 'default))))
44 (font-set-face-background 'default color (current-buffer))))
47 (defvar mime-w3-message-structure nil)
49 (defun mime-preview-text/html (entity situation)
50 (setq mime-w3-message-structure (mime-find-root-entity entity))
51 (goto-char (point-max))
55 (mime-save-background-color
57 (narrow-to-region p p)
58 (mime-insert-text-content entity)
59 (run-hooks 'mime-text-decode-hook)
61 (w3-region p (point-max))
62 (error (message "%s" err)))
63 (mime-put-keymap-region p (point-max) w3-mode-map)))))
65 (defun url-cid (url &optional proxy-info)
67 (mime-find-entity-from-content-id (mime-uri-parse-cid url)
68 mime-w3-message-structure))
71 (setq buffer (generate-new-buffer (format " *cid %s" url)))
74 (mime-insert-entity-content entity)
75 (if (boundp 'url-current-mime-type)
76 (setq url-current-mime-type (mime-entity-type/subtype entity)))))
79 (if (fboundp 'url-register-protocol)
80 (url-register-protocol "cid"
82 'url-identity-expander)
91 ;;; mime-w3.el ends here