* mime.el (mime-find-root-entity): Find root entity recursively.
authoryamaoka <yamaoka>
Fri, 9 Mar 2001 06:26:31 +0000 (06:26 +0000)
committeryamaoka <yamaoka>
Fri, 9 Mar 2001 06:26:31 +0000 (06:26 +0000)
ChangeLog
mime.el

index b1a3e67..06cacf2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-03-09  Akihiro Arisawa  <ari@atesoft.advantest.co.jp>
+
+       * mime.el (mime-find-root-entity): Find root recursively.
+
 2000-12-28  Katsumi Yamaoka   <yamaoka@jpl.org>
 
        * mel.el (binary-to-text-funcall, binary-funcall): Rewrite using
diff --git a/mime.el b/mime.el
index 8d6a146..5709032 100644 (file)
--- a/mime.el
+++ b/mime.el
@@ -149,10 +149,9 @@ If MESSAGE is specified, it is regarded as root entity."
 
 (defun mime-find-root-entity (entity)
   "Return root entity of ENTITY."
-  (let ((p (mime-entity-parent entity)))
-    (if (null p)
-       entity
-      (mime-entity-parent p))))
+  (while (not (mime-root-entity-p entity))
+    (setq entity (mime-entity-parent entity)))
+  entity)
 
 
 ;;; @ Header buffer (obsolete)