* wl-thread.el (wl-thread-insert-message): Use wl-summary-max-thread-depth.
authorteranisi <teranisi>
Fri, 13 Dec 2002 06:23:37 +0000 (06:23 +0000)
committerteranisi <teranisi>
Fri, 13 Dec 2002 06:23:37 +0000 (06:23 +0000)
* 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
wl/wl-message.el
wl/wl-summary.el
wl/wl-thread.el

index 4cad7f9..c66dc1d 100644 (file)
@@ -1,3 +1,14 @@
+2002-12-13  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * 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  <teranisi@gohome.org>
 
        * wl-vars.el (wl-summary-max-thread-depth): New user option.
index 6ce3e1e..c094061 100644 (file)
@@ -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.
index f84c808..ab0ca52 100644 (file)
@@ -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))
index 5e5bca3..c12135f 100644 (file)
@@ -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