*** empty log message ***
[gnus] / lisp / mm-view.el
1 ;;; mm-view.el --- Functions for viewing MIME objects
2 ;; Copyright (C) 1998,99 Free Software Foundation, Inc.
3
4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
5 ;; This file is part of GNU Emacs.
6
7 ;; GNU Emacs is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 2, or (at your option)
10 ;; any later version.
11
12 ;; GNU Emacs is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ;; GNU General Public License for more details.
16
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
19 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 ;; Boston, MA 02111-1307, USA.
21
22 ;;; Commentary:
23
24 ;;; Code:
25
26 (require 'mail-parse)
27 (require 'mailcap)
28 (require 'mm-bodies)
29 (require 'mm-decode)
30
31 (eval-and-compile
32   (autoload 'gnus-article-prepare-display "gnus-art")
33   (autoload 'vcard-parse-string "vcard")
34   (autoload 'vcard-format-string "vcard"))
35
36 ;;;
37 ;;; Functions for displaying various formats inline
38 ;;;
39
40 (defun mm-inline-image (handle)
41   (let ((b (point))
42         (annot (make-annotation (mm-get-image handle) nil 'text))
43         buffer-read-only)
44     (insert "\n")
45     (mm-handle-set-undisplayer
46      handle
47      `(lambda ()
48         (let (buffer-read-only)
49           (delete-annotation ,annot)
50           (delete-region ,(set-marker (make-marker) b)
51                          ,(set-marker (make-marker) (point))))))
52     (set-extent-property annot 'mm t)
53     (set-extent-property annot 'duplicable t)))
54
55 (defvar mm-w3-setup nil)
56 (defun mm-setup-w3 ()
57   (unless mm-w3-setup
58     (require 'w3)
59     (w3-do-setup)
60     (require 'url)