(gnus-topic-display-missing-topic): New function.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 29 Dec 2002 18:04:05 +0000 (18:04 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 29 Dec 2002 18:04:05 +0000 (18:04 +0000)
(gnus-topic-goto-missing-group): Use it.

lisp/ChangeLog
lisp/gnus-score.el
lisp/gnus-topic.el

index 0852bdd..48d6d58 100644 (file)
@@ -1,5 +1,8 @@
 2002-12-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-topic.el (gnus-topic-display-missing-topic): New function.
+       (gnus-topic-goto-missing-group): Use it.
+
        * message.el (message-required-news-headers): Removed Lines.
        (message-reply): Don't insert References first.
        (message-followup): Ditto.
index b37b6a0..1bad98f 100644 (file)
@@ -935,7 +935,6 @@ EXTRA is the possible non-standard header."
 
 ;; All score code written by Per Abrahamsen <abraham@iesd.auc.dk>.
 
-;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
 (defun gnus-score-set-mark-below (score)
   "Automatically mark articles with score below SCORE as read."
   (interactive
index 836c013..544d48b 100644 (file)
@@ -696,7 +696,8 @@ articles in the topic and its subtopics."
         (unfound t)
         entry)
     ;; Try to jump to a visible group.
-    (while (and g (not (gnus-group-goto-group (car g) t)))
+    (while (and g
+               (not (gnus-group-goto-group (car g) t)))
       (pop g))
     ;; It wasn't visible, so we try to see where to insert it.
     (when (not g)
@@ -708,20 +709,30 @@ articles in the topic and its subtopics."
       (when (and unfound
                 topic
                 (not (gnus-topic-goto-missing-topic topic)))
-       (let* ((top (gnus-topic-find-topology topic))
-              (children (cddr top))
-              (type (cadr top))
-              (unread 0)
-              (entries (gnus-topic-find-groups
-                        (car type) (car gnus-group-list-mode)
-                        (cdr gnus-group-list-mode))))
-         (while children
-           (incf unread (gnus-topic-unread (caar (pop children)))))
-         (while (setq entry (pop entries))
-           (when (numberp (car entry))
-             (incf unread (car entry))))
-         (gnus-topic-insert-topic-line
-          topic t t (car (gnus-topic-find-topology topic)) nil unread))))))
+       (gnus-topic-display-missing-topic topic)))))
+
+(defun gnus-topic-display-missing-topic (topic)
+  "Insert topic lines recursively for missing topics."
+  (let ((parent (gnus-topic-find-topology
+                (gnus-topic-parent-topic topic))))
+    (when (and parent
+              (not (gnus-topic-goto-missing-topic (caadr parent))))
+      (gnus-topic-display-missing-topic (caadr parent))))
+  (gnus-topic-goto-missing-topic topic)
+  (let* ((top (gnus-topic-find-topology topic))
+        (children (cddr top))
+        (type (cadr top))
+        (unread 0)
+        (entries (gnus-topic-find-groups
+                  (car type) (car gnus-group-list-mode)
+                  (cdr gnus-group-list-mode))))
+    (while children
+      (incf unread (gnus-topic-unread (caar (pop children)))))
+    (while (setq entry (pop entries))
+      (when (numberp (car entry))
+       (incf unread (car entry))))
+    (gnus-topic-insert-topic-line
+     topic t t (car (gnus-topic-find-topology topic)) nil unread)))
 
 (defun gnus-topic-goto-missing-topic (topic)
   (if (gnus-topic-goto-topic topic)