* mm-decoce.el (mm-multiple-handles): Recognize a string as a mime handle,
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 15 Jan 2004 10:59:39 +0000 (10:59 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 15 Jan 2004 10:59:39 +0000 (10:59 +0000)
 as well as a list.

* mm-view.el (mm-w3m-cid-retrieve-1): Call itself recursively.  Suggested
 by ARISAWA Akihiro <ari@mbf.sphere.ne.jp>.
(mm-w3m-cid-retrieve): Simplify.

lisp/ChangeLog
lisp/mm-decode.el
lisp/mm-view.el

index 821ca6c..ea66135 100644 (file)
@@ -1,3 +1,12 @@
+2004-01-15  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mm-decoce.el (mm-multiple-handles): Recognize a string as a mime
+       handle, as well as a list.
+
+       * mm-view.el (mm-w3m-cid-retrieve-1): Call itself recursively.
+       Suggested by ARISAWA Akihiro <ari@mbf.sphere.ne.jp>.
+       (mm-w3m-cid-retrieve): Simplify.
+
 2004-01-14  Kai Grossjohann  <kai@emptydomain.de>
 
        * message.el (message-kill-to-signature): Allow prefix arg to
index 1a8fc46..5cdd171 100644 (file)
@@ -1451,8 +1451,10 @@ If RECURSIVE, search recursively."
     parts))
 
 (defun mm-multiple-handles (handles)
-  (and (listp (car handles))
-       (> (length handles) 1)))
+  (and (listp handles)
+       (> (length handles) 1)
+       (or (listp (car handles))
+          (stringp (car handles)))))
 
 (defun mm-merge-handles (handles1 handles2)
   (append
index 989862c..4cfdf50 100644 (file)
   (setq w3m-display-inline-images mm-inline-text-html-with-images))
 
 (defun mm-w3m-cid-retrieve-1 (url handle)
-  (dolist (elem handle)
-    (when (and (listp elem)
-              (equal url (mm-handle-id elem)))
-      (mm-insert-part elem)
-      (throw 'found-handle (mm-handle-media-type elem)))))
+  (if (mm-multiple-handles handle)
+      (dolist (elem handle)
+       (mm-w3m-cid-retrieve-1 url elem))
+    (when (and (listp handle)
+              (equal url (mm-handle-id handle)))
+      (mm-insert-part handle)
+      (throw 'found-handle (mm-handle-media-type handle)))))
 
 (defun mm-w3m-cid-retrieve (url &rest args)
   "Insert a content pointed by URL if it has the cid: scheme."
   (when (string-match "\\`cid:" url)
-    (setq url (concat "<" (substring url (match-end 0)) ">"))
     (catch 'found-handle
-      (let ((handles (with-current-buffer w3m-current-buffer
-                      gnus-article-mime-handles)))
-       (if (mm-multiple-handles handles)
-           (dolist (handle handles)
-             (mm-w3m-cid-retrieve-1 url handle))
-         (mm-w3m-cid-retrieve-1 url handles))))))
+      (mm-w3m-cid-retrieve-1 (concat "<" (substring url (match-end 0)) ">")
+                            (with-current-buffer w3m-current-buffer
+                              gnus-article-mime-handles)))))
 
 (defun mm-inline-text-html-render-with-w3m (handle)
   "Render a text/html part using emacs-w3m."