From 3288a750fdb7f24e0a3fce2b14a613f37f9a1d3b Mon Sep 17 00:00:00 2001 From: hmurata Date: Fri, 31 Oct 2003 17:40:07 +0000 Subject: [PATCH] (wl-summary-insert-thread): Fixed the logic to detect thread loop. --- wl/ChangeLog | 5 +++++ wl/wl-summary.el | 23 ++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 3c24a5e..7d2ce03 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,8 @@ +2003-10-31 Hiroya Murata + + * wl-summary.el (wl-summary-insert-thread): Fixed the logic to + detect thread loop. + 2003-10-27 Hiroya Murata * wl-spam.el (wl-spam-setup): Modify wl-summary-reserve-mark-list diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 1e91ba5..fbd0084 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -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)) -- 1.7.10.4