* wl-thread.el (wl-thread-insert-message): Use wl-summary-max-thread-depth.
authorteranisi <teranisi>
Fri, 13 Dec 2002 06:25:42 +0000 (06:25 +0000)
committerteranisi <teranisi>
Fri, 13 Dec 2002 06:25:42 +0000 (06:25 +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 6d777d7..e385ab1 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 0eef8c7..e9a5f43 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 e5bd902..93e607f 100644 (file)
@@ -2705,7 +2705,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
@@ -2715,15 +2715,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 0696269..462c28c 100644 (file)
@@ -646,11 +646,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