2001-01-09 01:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Tue, 9 Jan 2001 06:57:53 +0000 (06:57 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Tue, 9 Jan 2001 06:57:53 +0000 (06:57 +0000)
* mm-decode.el (mm-interactively-view-part): Don't copy-sequence
handle.
* gnus-art.el (gnus-mime-view-part): Copy it.
(gnus-mime-view-part-as-type): Add into gnus-article-mime-handles.

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

index c7409c9..9f7a399 100644 (file)
@@ -1,3 +1,10 @@
+2001-01-09 01:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * mm-decode.el (mm-interactively-view-part): Don't copy-sequence
+       handle.
+       * gnus-art.el (gnus-mime-view-part): Copy it.
+       (gnus-mime-view-part-as-type): Add into gnus-article-mime-handles.
+
 2001-01-09  Michael Downes <mjd@ams.org>
 
        * gnus-sum.el (gnus-summary-read-group-1): More useful message.
index f9fef4e..c2d3159 100644 (file)
@@ -3280,6 +3280,7 @@ If ALL-HEADERS is non-nil, no headers are hidden."
   (gnus-article-check-buffer)
   (let ((data (get-text-property (point) 'gnus-data)))
     (when data
+      (push (setq data (copy-sequence data)) gnus-article-mime-handles)
       (mm-interactively-view-part data))))
 
 (defun gnus-mime-view-part-as-type-internal ()
@@ -3290,27 +3291,30 @@ If ALL-HEADERS is non-nil, no headers are hidden."
         (def-type (and name (mm-default-file-encoding name))))
     (and def-type (cons def-type 0))))
 
-(defun gnus-mime-view-part-as-type (mime-type)
+(defun gnus-mime-view-part-as-type (&optional mime-type)
   "Choose a MIME media type, and view the part as such."
-  (interactive
-   (list (completing-read
-         "View as MIME type: "
-         (mapcar #'list (mailcap-mime-types))
-         nil nil
-         (gnus-mime-view-part-as-type-internal))))
+  (interactive)
+  (unless mime-type
+    (setq mime-type (completing-read
+                    "View as MIME type: "
+                    (mapcar #'list (mailcap-mime-types))
+                    nil nil
+                    (gnus-mime-view-part-as-type-internal))))
   (gnus-article-check-buffer)
   (let ((handle (get-text-property (point) 'gnus-data)))
     (when handle
-      (gnus-mm-display-part
-       (mm-make-handle (mm-handle-buffer handle)
-                      (cons mime-type (cdr (mm-handle-type handle)))
-                      (mm-handle-encoding handle)
-                      (mm-handle-undisplayer handle)
-                      (mm-handle-disposition handle)
-                      (mm-handle-description handle)
-                      (mm-handle-cache handle)
-                      (mm-handle-id handle))))))
-  
+      (setq handle
+           (mm-make-handle (mm-handle-buffer handle)
+                           (cons mime-type (cdr (mm-handle-type handle)))
+                           (mm-handle-encoding handle)
+                           (mm-handle-undisplayer handle)
+                           (mm-handle-disposition handle)
+                           (mm-handle-description handle)
+                           (mm-handle-cache handle)
+                           (mm-handle-id handle)))
+      (push handle gnus-article-mime-handles)
+      (gnus-mm-display-part handle))))
+
 (defun gnus-mime-copy-part (&optional handle)
   "Put the the MIME part under point into a new buffer."
   (interactive)
index 786a3be..37ad4df 100644 (file)
@@ -842,7 +842,7 @@ external if displayed external."
       (error "No method given"))
     (if (string-match "^[^% \t]+$" method) 
        (setq method (concat method " %s")))
-    (mm-display-external (copy-sequence handle) method)))
+    (mm-display-external handle method)))
 
 (defun mm-preferred-alternative (handles &optional preferred)
   "Say which of HANDLES are preferred."