(wl-summary-insert-thread): Fixed the logic to
authorhmurata <hmurata>
Fri, 31 Oct 2003 17:40:07 +0000 (17:40 +0000)
committerhmurata <hmurata>
Fri, 31 Oct 2003 17:40:07 +0000 (17:40 +0000)
detect thread loop.

wl/ChangeLog
wl/wl-summary.el

index 3c24a5e..7d2ce03 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-31  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * wl-summary.el (wl-summary-insert-thread): Fixed the logic to
+       detect thread loop.
+
 2003-10-27  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * wl-spam.el (wl-spam-setup): Modify wl-summary-reserve-mark-list
index 1e91ba5..fbd0084 100644 (file)
@@ -2563,8 +2563,8 @@ If ARG, without confirm."
 (defun wl-summary-insert-thread (entity folder update
                                        &optional force-insert)
   (let ((depth 0)
-       this-id parent-entity parent-number relatives anumber
-       cur number cur-entity linked retval delayed-entity
+       this-id parent-entity parent-number
+       number cur-entity linked retval delayed-entity
        update-list entity-stack thread-entity)
     (while entity
       (setq this-id (elmo-message-entity-field entity 'message-id)
@@ -2583,16 +2583,17 @@ If ARG, without confirm."
              linked nil))
       (setq parent-number (and parent-entity
                               (elmo-message-entity-number parent-entity)))
-      (setq cur entity)
       ;; If thread loop detected, set parent as nil.
-      (while cur
-       (when (setq anumber
-                   (elmo-message-entity-number
-                    (setq cur (elmo-message-entity-parent folder cur))))
-         (if (memq anumber relatives)
-             (setq parent-number nil
-                   cur nil))
-         (setq relatives (cons anumber relatives))))
+      (let ((cur entity)
+           anumber relatives)
+       (while cur
+         (when (setq anumber
+                     (elmo-message-entity-number
+                      (setq cur (elmo-message-entity-parent folder cur))))
+           (if (memq anumber relatives)
+               (setq parent-number nil
+                     cur nil))
+           (setq relatives (cons anumber relatives)))))
       (if (and parent-number
               (not (wl-thread-get-entity parent-number))
               (not force-insert))