Implement showing/hiding topic permanently.
authorShengHuo ZHU <zsh@cs.rochester.edu>
Mon, 21 Aug 2000 14:33:43 +0000 (14:33 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Mon, 21 Aug 2000 14:33:43 +0000 (14:33 +0000)
lisp/ChangeLog
lisp/gnus-topic.el

index d698c9f..d274650 100644 (file)
@@ -1,3 +1,12 @@
+2000-08-21 10:09:47  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-topic.el (gnus-topic-hide-topic): Use find-topology if
+       permanent is used.
+       (gnus-topic-show-topic): Read topic when to show permanent hidden
+       topic.
+       (gnus-topic-remove-topic): Revert to the old behavior, not using
+       hide.
+
 2000-08-21  Dave Love  <fx@gnu.org>
 
        * mm-util.el (mm-read-charset): Maybe use builtin.
index 309b22c..2a320d4 100644 (file)
@@ -505,7 +505,7 @@ articles in the topic and its subtopics."
       (let ((data (cadr (gnus-topic-find-topology topic))))
        (setcdr data
                (list (if insert 'visible 'invisible)
-                     hide
+                     (caddr data)
                      (cadddr data))))
       (if total-remove
          (setq gnus-topic-alist
@@ -1271,7 +1271,11 @@ If PERMANENT, make it stay hidden in subsequent sessions as well."
   (interactive "P")
   (when (gnus-current-topic)
     (gnus-topic-goto-topic (gnus-current-topic))
-    (setcar (cddr (assoc (gnus-current-topic) gnus-topic-topology)) 'hidden)
+    (if permanent
+       (setcar (cddr 
+                (cadr
+                 (gnus-topic-find-topology (gnus-current-topic))))
+               'hidden))
     (gnus-topic-remove-topic nil nil)))
 
 (defun gnus-topic-show-topic (&optional permanent)
@@ -1279,8 +1283,14 @@ If PERMANENT, make it stay hidden in subsequent sessions as well."
 If PERMANENT, make it stay shown in subsequent sessions as well."
   (interactive "P")
   (when (gnus-group-topic-p)
-    (setcar (cddr (assoc (gnus-current-topic) gnus-topic-topology)) nil)
-    (gnus-topic-remove-topic t nil)))
+    (if (not permanent)
+       (gnus-topic-remove-topic t nil)
+      (let ((topic 
+            (gnus-topic-find-topology 
+             (completing-read "Show topic: " gnus-topic-alist nil t))))
+       (setcar (cddr (cadr topic)) nil)
+       (setcar (cdr (cadr topic)) 'visible)
+       (gnus-group-list-groups)))))
 
 (defun gnus-topic-mark-topic (topic &optional unmark)
   "Mark all groups in the topic with the process mark."