2000-11-07 08:49:36 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Tue, 7 Nov 2000 12:57:22 +0000 (12:57 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Tue, 7 Nov 2000 12:57:22 +0000 (12:57 +0000)
* mm-decode.el (mm-display-parts): New function.
* gnus-art.el (gnus-mime-view-all-parts): Use it. Remove parts first.

lisp/ChangeLog
lisp/gnus-art.el
lisp/mm-decode.el

index 4329681..6f7220a 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-07 08:49:36  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * mm-decode.el (mm-display-parts): New function.
+       * gnus-art.el (gnus-mime-view-all-parts): Use it. Remove parts first.
+
 2000-02-02 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
 
        * gnus-mlspl.el: Documentation tweaks.
index b0256e5..996866b 100644 (file)
@@ -2983,11 +2983,14 @@ If ALL-HEADERS is non-nil, no headers are hidden."
     (let ((handles (or handles gnus-article-mime-handles))
          (mail-parse-charset gnus-newsgroup-charset)
          (mail-parse-ignored-charsets 
-          (save-excursion (set-buffer gnus-summary-buffer)
-                          gnus-newsgroup-ignored-charsets)))
-      (if (stringp (car handles))
-         (gnus-mime-view-all-parts (cdr handles))
-       (mapcar 'mm-display-part handles)))))
+          (with-current-buffer gnus-summary-buffer
+            gnus-newsgroup-ignored-charsets)))
+      (mm-remove-parts handles)
+      (goto-char (point-min))
+      (or (search-forward "\n\n") (goto-char (point-max)))
+      (let (buffer-read-only)
+       (delete-region (point) (point-max)))
+      (mm-display-parts handles))))
 
 (defun gnus-mime-save-part-and-strip ()
   "Save the MIME part under point then replace it with an external body."
index c9247e3..b0ff1d8 100644 (file)
@@ -418,6 +418,16 @@ The original alist is not modified.  See also `destructive-alist-to-plist'."
       (insert-buffer-substring obuf beg)
       (current-buffer))))
 
+(defun mm-display-parts (handle &optional no-default)
+  (if (stringp (car handle))
+      (mapcar 'mm-display-parts (cdr handle))
+    (if (bufferp (car handle))
+       (save-restriction
+         (narrow-to-region (point) (point))
+         (mm-display-part handle)
+         (goto-char (point-max)))
+      (mapcar 'mm-display-parts handle))))
+
 (defun mm-display-part (handle &optional no-default)
   "Display the MIME part represented by HANDLE.
 Returns nil if the part is removed; inline if displayed inline;