(gnus-group-jump-to-group-prompt): New variable by
[gnus] / lisp / gnus-group.el
index ccdbf49..3208135 100644 (file)
@@ -412,6 +412,12 @@ For example:
   :group 'gnus-charset
   :type '(repeat (cons (regexp :tag "Group") (symbol :tag "Charset"))))
 
+(defvar gnus-group-jump-to-group-prompt nil
+  "GNUS-GROUP-JUMP-TO-GROUP prompt.
+If non-nil, the value should be a string, e.g. \"nnml:\",
+in which case GNUS-GROUP-JUMP-TO-GROUP offers \"Group: nnml:\"
+in the minibuffer prompt.")
+
 ;;; Internal variables
 
 (defvar gnus-group-sort-alist-function 'gnus-group-sort-flat
@@ -1052,6 +1058,8 @@ if it is a string, only list groups matching REGEXP."
   (let ((buffer-read-only nil)
        (newsrc (cdr gnus-newsrc-alist))
        (lowest (or lowest 1))
+       (not-in-list (and gnus-group-listed-groups
+                         (copy-sequence gnus-group-listed-groups)))
        info clevel unread group params)
     (erase-buffer)
     (when (or (< lowest gnus-level-zombie)
@@ -1063,6 +1071,8 @@ if it is a string, only list groups matching REGEXP."
              params (gnus-info-params info)
              newsrc (cdr newsrc)
              unread (car (gnus-gethash group gnus-newsrc-hashtb)))
+       (if not-in-list 
+           (setq not-in-list (delete group not-in-list)))
        (and 
         (gnus-group-prepare-logic 
          group
@@ -1102,10 +1112,15 @@ if it is a string, only list groups matching REGEXP."
         (setq gnus-zombie-list (sort gnus-zombie-list 'string<))
         gnus-level-zombie ?Z
         regexp))
+    (if not-in-list 
+       (dolist (group gnus-zombie-list)
+         (setq not-in-list (delete group not-in-list))))
     (if (or gnus-group-listed-groups
            (and (>= level gnus-level-killed) (<= lowest gnus-level-killed)))
        (gnus-group-prepare-flat-list-dead
-        (setq gnus-killed-list (sort gnus-killed-list 'string<))
+        (gnus-union 
+         not-in-list
+         (setq gnus-killed-list (sort gnus-killed-list 'string<)))
         gnus-level-killed ?K regexp))
 
     (gnus-group-set-mode-line)
@@ -1125,16 +1140,25 @@ if it is a string, only list groups matching REGEXP."
             (or (not regexp)
                 (and (stringp regexp) (string-match regexp group))
                 (and (functionp regexp) (funcall regexp group))))
-       (gnus-add-text-properties
-        (point) (prog1 (1+ (point))
-                  (insert " " mark "     *: "
-                          (gnus-group-name-decode group 
-                                                  (gnus-group-name-charset
-                                                   nil group)) 
-                          "\n"))
-        (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
-              'gnus-unread t
-              'gnus-level level))))))
+;;;    (gnus-add-text-properties
+;;;     (point) (prog1 (1+ (point))
+;;;               (insert " " mark "     *: "
+;;;                       (gnus-group-name-decode group 
+;;;                                               (gnus-group-name-charset
+;;;                                                nil group)) 
+;;;                       "\n"))
+;;;     (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
+;;;           'gnus-unread t
+;;;           'gnus-level level))
+       (gnus-group-insert-group-line 
+        group level nil
+        (let ((active (gnus-active group)))
+          (if active
+              (if (zerop (cdr active))
+                  0
+                (- (1+ (cdr active)) (car active)))
+            nil))
+        (gnus-method-simplify (gnus-find-method-for-group group)))))))
 
 (defun gnus-group-update-group-line ()
   "Update the current line in the group buffer."
@@ -1177,7 +1201,7 @@ if it is a string, only list groups matching REGEXP."
               0
             (- (1+ (cdr active)) (car active)))
         nil)
-       nil))))
+       (gnus-method-simplify (gnus-find-method-for-group group))))))
 
 (defun gnus-group-insert-group-line (gnus-tmp-group gnus-tmp-level
                                                    gnus-tmp-marked number
@@ -1807,7 +1831,7 @@ Return the name of the group if selection was successful."
    (list (completing-read
          "Group: " gnus-active-hashtb nil
          (gnus-read-active-file-p)
-         nil
+         gnus-group-jump-to-group-prompt
          'gnus-group-history)))
 
   (when (equal group "")