From a71b937153844e649c4db327be478abb23444ce5 Mon Sep 17 00:00:00 2001 From: teranisi Date: Fri, 13 Dec 2002 06:23:37 +0000 Subject: [PATCH] * wl-thread.el (wl-thread-insert-message): Use wl-summary-max-thread-depth. * wl-summary.el (wl-summary-insert-thread-entity): Refined loop detection. * wl-message.el (wl-message-buffer-display): Back to the first page when cache is hit. --- wl/ChangeLog | 11 +++++++++++ wl/wl-message.el | 4 ++++ wl/wl-summary.el | 17 ++++++++++------- wl/wl-thread.el | 8 ++++++++ 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 4cad7f9..c66dc1d 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,14 @@ +2002-12-13 Yuuichi Teranishi + + * wl-thread.el (wl-thread-insert-message): Use + wl-summary-max-thread-depth. + + * wl-summary.el (wl-summary-insert-thread-entity): Refined + loop detection. + + * wl-message.el (wl-message-buffer-display): Back to the first page + when cache is hit. + 2002-12-12 Yuuichi Teranishi * wl-vars.el (wl-summary-max-thread-depth): New user option. diff --git a/wl/wl-message.el b/wl/wl-message.el index 6ce3e1e..c094061 100644 --- a/wl/wl-message.el +++ b/wl/wl-message.el @@ -481,6 +481,10 @@ Returns non-nil if bottom of message." ;; buffer cache is used. (setq cache-used t) (with-current-buffer hit + ;; Rewind to the top page + (widen) + (goto-char (point-min)) + (ignore-errors (wl-message-narrow-to-page)) (unless (eq wl-message-buffer-cur-flag flag) (setq read t)))) ;; delete tail and add new to the top. diff --git a/wl/wl-summary.el b/wl/wl-summary.el index f84c808..ab0ca52 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -2747,7 +2747,7 @@ If ARG, without confirm." parent-entity parent-number (case-fold-search t) - (depth 0) + (depth 0) relatives anumber cur number overview2 cur-entity linked retval delayed-entity update-list entity-stack) (while entity @@ -2757,15 +2757,18 @@ If ARG, without confirm." parent-number (elmo-msgdb-overview-entity-get-number parent-entity)) (setq number (elmo-msgdb-overview-entity-get-number entity)) - ;; If thread loop detected or reached to max depth, set parent as nil. (setq cur entity) - (while (and cur (< depth wl-summary-max-thread-depth)) - (if (eq number (elmo-msgdb-overview-entity-get-number - (setq cur - (elmo-msgdb-get-parent-entity cur msgdb)))) + ;; If thread loop detected, set parent as nil. + (while cur + (setq anumber + (elmo-msgdb-overview-entity-get-number + (setq cur (elmo-msgdb-get-parent-entity cur msgdb)))) + (if (memq anumber relatives) (setq parent-number nil cur nil)) - (incf depth)) + (setq relatives (cons + (elmo-msgdb-overview-entity-get-number cur) + relatives))) (if (and parent-number (not (wl-thread-get-entity parent-number)) (not force-insert)) diff --git a/wl/wl-thread.el b/wl/wl-thread.el index 5e5bca3..c12135f 100644 --- a/wl/wl-thread.el +++ b/wl/wl-thread.el @@ -650,11 +650,19 @@ ENTITY is returned." When optional argument UPDATE is non-nil, Message is inserted to the summary buffer." (let ((parent (wl-thread-get-entity parent-msg)) + (depth 0) cur child-entity invisible-top) ;;; Update the thread view...not implemented yet. ;;; (when force-insert ;;; (if parent ;;; (wl-thread-entity-force-open parent)) + (when (and wl-summary-max-thread-depth parent) + (setq cur parent) + (while cur + (incf depth) + (setq cur (wl-thread-entity-get-parent-entity cur))) + (when (> depth wl-summary-max-thread-depth) + (setq parent nil))) (if parent ;; insert as children. (wl-thread-entity-insert-as-children -- 1.7.10.4