;;; mm-view.el --- Functions for viewing MIME objects
-;; Copyright (C) 1998,99 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; This file is part of GNU Emacs.
(autoload 'gnus-article-prepare-display "gnus-art")
(autoload 'vcard-parse-string "vcard")
(autoload 'vcard-format-string "vcard")
- (autoload 'fill-flowed "fill-flowed")
+ (autoload 'fill-flowed "flow-fill")
(autoload 'diff-mode "diff-mode"))
;;;
;;; Functions for displaying various formats inline
;;;
+(defun mm-inline-image-emacs (handle)
+ (let ((b (point))
+ (overlay nil)
+ (string (copy-sequence "[MM-INLINED-IMAGE]"))
+ buffer-read-only)
+ (insert "\n")
+ (buffer-name)
+ (setq overlay (make-overlay (point) (point) (current-buffer)))
+ (put-text-property 0 (length string) 'display (mm-get-image handle) string)
+ (overlay-put overlay 'before-string string)
-(defun mm-inline-image (handle)
+ (mm-handle-set-undisplayer
+ handle
+ `(lambda ()
+ (let (buffer-read-only)
+ (delete-overlay ,overlay)
+ (delete-region ,(set-marker (make-marker) b)
+ ,(set-marker (make-marker) (point))))))))
+
+(defun mm-inline-image-xemacs (handle)
(let ((b (point))
(annot (make-annotation (mm-get-image handle) nil 'text))
buffer-read-only)
(set-extent-property annot 'mm t)
(set-extent-property annot 'duplicable t)))
+(defun mm-inline-image (handle)
+ (if mm-xemacs-p
+ (mm-inline-image-xemacs handle)
+ (mm-inline-image-emacs handle)))
+
(defvar mm-w3-setup nil)
(defun mm-setup-w3 ()
(unless mm-w3-setup
(narrow-to-region b b)
(mm-insert-part handle)
(let (gnus-article-mime-handles
+ ;; disable prepare hook
+ gnus-article-prepare-hook
(gnus-newsgroup-charset
(or charset gnus-newsgroup-charset)))
(run-hooks 'gnus-article-decode-hook)