Synch to No Gnus 200407171659.
[elisp/gnus.git-] / lisp / gnus-group.el
index d89e51b..7818828 100644 (file)
@@ -640,7 +640,7 @@ simple manner.")
   "a" gnus-group-make-archive-group
   "k" gnus-group-make-kiboze-group
   "l" gnus-group-nnimap-edit-acl
-  "m" gnus-group-make-group
+  "m" gnus-group-make-group-simple
   "n" gnus-group-make-shimbun-group
   "E" gnus-group-edit-group
   "e" gnus-group-edit-group-method
@@ -910,6 +910,7 @@ simple manner.")
        ["Kill all groups on level..." gnus-group-kill-level t])
        ("Foreign groups"
        ["Make a foreign group..." gnus-group-make-group t]
+       ["Make a foreign group..." gnus-group-make-group-simple t]
        ["Make a shimbun group..." gnus-group-make-shimbun-group t]
        ["Add a directory group..." gnus-group-make-directory-group t]
        ["Add the help group" gnus-group-make-help-group t]
@@ -1050,7 +1051,8 @@ The following commands are available:
   (use-local-map gnus-group-mode-map)
   (buffer-disable-undo)
   (setq truncate-lines t)
-  (setq buffer-read-only t)
+  (setq buffer-read-only t
+       show-trailing-whitespace nil)
   (gnus-set-default-directory)
   (gnus-update-format-specifications nil 'group 'group-mode)
   (gnus-update-group-mark-positions)
@@ -1945,7 +1947,10 @@ group."
 No article is selected automatically.
 If the group is opened, just switch the summary buffer.
 If ALL is non-nil, already read articles become readable.
-If ALL is a number, fetch this number of articles."
+If ALL is a positive number, fetch this number of the latest
+articles in the group.
+If ALL is a negative number, fetch this number of the earliest
+articles in the group."
   (interactive "P")
   (when (and (eobp) (not (gnus-group-group-name)))
     (forward-line -1))
@@ -2126,11 +2131,7 @@ If PROMPT (the prefix) is a number, use the prompt specified in
     ;; Either go to the line in the group buffer...
     (unless (gnus-group-goto-group group)
       ;; ... or insert the line.
-      (if (or (gnus-active group)
-             (gnus-y-or-n-p
-              (format "Group %s is not active.  Continue? " group)))
-         (gnus-group-update-group group)
-       (error "No such group: %s." group))
+      (gnus-group-update-group group)
       (gnus-group-goto-group group)))
   ;; Adjust cursor point.
   (gnus-group-position-point))
@@ -2290,6 +2291,16 @@ If EXCLUDE-GROUP, do not go to that group."
   (interactive)
   (gnus-enter-server-buffer))
 
+(defun gnus-group-make-group-simple (&optional group)
+  "Add a new newsgroup.
+The user will be prompted for GROUP."
+  (interactive
+   (list (completing-read "Group: " gnus-active-hashtb
+                         nil nil nil 'gnus-group-history)))
+  (gnus-group-make-group
+   (gnus-group-real-name group)
+   (gnus-group-server group)))
+
 (defun gnus-group-make-group (name &optional method address args)
   "Add a new newsgroup.
 The user will be prompted for a NAME, for a select METHOD, and an
@@ -3668,7 +3679,8 @@ re-scanning.  If ARG is non-nil and not a number, this will force
 (defun gnus-group-get-new-news-this-group (&optional n dont-scan)
   "Check for newly arrived news in the current group (and the N-1 next groups).
 The difference between N and the number of newsgroup checked is returned.
-If N is negative, this group and the N-1 previous groups will be checked."
+If N is negative, this group and the N-1 previous groups will be checked.
+If DONT-SCAN is non-nil, scan non-activated groups as well."
   (interactive "P")
   (let* ((groups (gnus-group-process-prefix n))
         (ret (if (numberp n) (- n (length groups)) 0))
@@ -3684,15 +3696,17 @@ If N is negative, this group and the N-1 previous groups will be checked."
       (gnus-group-remove-mark group)
       ;; Bypass any previous denials from the server.
       (gnus-remove-denial (setq method (gnus-find-method-for-group group)))
-      (if (gnus-activate-group group (if dont-scan nil 'scan))
-         (progn
-           (gnus-get-unread-articles-in-group
-            (gnus-get-info group) (gnus-active group) t)
+      (if (gnus-activate-group group (if dont-scan nil 'scan) nil method)
+         (let ((info (gnus-get-info group))
+               (active (gnus-active group)))
+           (when info
+             (gnus-request-update-info info method))
+           (gnus-get-unread-articles-in-group info active)
            (unless (gnus-virtual-group-p group)
              (gnus-close-group group))
            (when gnus-agent
              (gnus-agent-save-group-info
-              method (gnus-group-real-name group) (gnus-active group)))
+              method (gnus-group-real-name group) active))
            (gnus-group-update-group group))
        (if (eq (gnus-server-status (gnus-find-method-for-group group))
                'denied)