Synch to Oort Gnus 200304070816.
[elisp/gnus.git-] / lisp / mml.el
index ff3f98e..35e279e 100644 (file)
@@ -1,5 +1,6 @@
 ;;; mml.el --- A package for parsing and validating MML documents
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
+;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
@@ -737,7 +738,7 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
        (mml-insert-mml-markup handle buffer textp)))
     (cond
      (mmlp
-      (insert-buffer buffer)
+      (insert-buffer-substring buffer)
       (goto-char (point-max))
       (insert "<#/mml>\n"))
      ((stringp (car handle))
@@ -1038,7 +1039,7 @@ If RAW, don't highlight the article."
                         (concat (if raw "*Raw MIME preview of "
                                   "*MIME preview of ") (buffer-name))))
       (erase-buffer)
-      (insert-buffer buf)
+      (insert-buffer-substring buf)
       (mml-preview-insert-mail-followup-to)
       (let ((message-deletable-headers (if (message-news-p)
                                           nil
@@ -1068,6 +1069,10 @@ If RAW, don't highlight the article."
            (gnus-article-prepare-display))))
       ;; Disable article-mode-map.
       (use-local-map nil)
+      (make-local-hook 'kill-buffer-hook)
+      (add-hook 'kill-buffer-hook
+               (lambda ()
+                 (mm-destroy-parts gnus-article-mime-handles)) nil t)
       (setq buffer-read-only t)
       (local-set-key "q" (lambda () (interactive) (kill-buffer nil)))
       (goto-char (point-min)))))