*** empty log message ***
[gnus] / lisp / nntp.el
index 028df1e..95499b8 100644 (file)
@@ -1,4 +1,4 @@
-;; Copyright (C) 1987,88,89,90,92,93,94,95,96 Free Software Foundation, Inc.
+;;; Copyright (C) 1987,88,89,90,92,93,94,95,96 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
 ;; Keywords: news
@@ -54,7 +54,9 @@ do on servers that use strict access control.")
 
 (defvoo nntp-server-action-alist 
   '(("nntpd 1\\.5\\.11t" 
-     (remove-hook 'nntp-server-opened-hook 'nntp-send-mode-reader)))
+     (remove-hook 'nntp-server-opened-hook 'nntp-send-mode-reader))
+    ("NNRP server Netscape" 
+     (setq nntp-server-list-active-group nil)))
   "Alist of regexps to match on server types and actions to be taken.
 For instance, if you want Gnus to beep every time you connect
 to innd, you could say something like:
@@ -115,7 +117,7 @@ lower value.")
 
 (defvoo nntp-xover-commands '("XOVER" "XOVERVIEW")
   "*List of strings that are used as commands to fetch NOV lines from a server.
-The strings are tried in turn until a positive response is gotten. If
+The strings are tried in turn until a positive response is gotten.  If
 none of the commands are successful, nntp will just grab headers one
 by one.")
 
@@ -134,7 +136,7 @@ If can be used to set up a server remotely, for instance.  Say you
 have an account at the machine \"other.machine\".  This machine has
 access to an NNTP server that you can't access locally.  You could
 then use this hook to rsh to the remote machine and start a proxy NNTP
-server there that you can connect to. See also `nntp-open-connection-function'")
+server there that you can connect to.  See also `nntp-open-connection-function'")
 
 (defvoo nntp-warn-about-losing-connection t
   "*If non-nil, beep when a server closes connection.")
@@ -287,7 +289,7 @@ server there that you can connect to. See also `nntp-open-connection-function'")
                   (not (re-search-backward "^\\.\r?\n" (- (point) 4) t))))
          (nntp-accept-response)))
 
-      ;; Now all replies are received. We remove CRs.
+      ;; Now all replies are received.  We remove CRs.
       (goto-char (point-min))
       (while (search-forward "\r" nil t)
        (replace-match "" t t))
@@ -297,7 +299,7 @@ server there that you can connect to. See also `nntp-open-connection-function'")
            (copy-to-buffer nntp-server-buffer (point-min) (point-max))
            'group)
        ;; We have read active entries, so we just delete the
-       ;; superfluos gunk.
+       ;; superfluous gunk.
        (goto-char (point-min))
        (while (re-search-forward "^[.2-5]" nil t)
          (delete-region (match-beginning 0) 
@@ -308,6 +310,7 @@ server there that you can connect to. See also `nntp-open-connection-function'")
 (defun nntp-try-list-active (group)
   (nntp-list-active-group group)
   (save-excursion
+    (set-buffer nntp-server-buffer)
     (goto-char (point-min))
     (cond ((looking-at "5[0-9]+")
           (setq nntp-server-list-active-group nil))
@@ -577,8 +580,10 @@ It will prompt for a password."
              (caar (push (list process buffer nil) 
                          nntp-connection-alist))
            (push process nntp-connection-list)
-           (nntp-read-server-type)
-           (run-hooks 'nntp-server-opened-hook))
+           (save-excursion
+             (set-buffer nntp-server-buffer)
+             (nntp-read-server-type)
+             (run-hooks 'nntp-server-opened-hook)))
        (when (buffer-name (process-buffer process))
          (kill-buffer (process-buffer process)))
        nil))))
@@ -592,7 +597,7 @@ It will prompt for a password."
   (setq nntp-server-type (buffer-string))
   (let ((alist nntp-server-action-alist)
        entry)
-    ;; Run server-specific commmands.
+    ;; Run server-specific commands.
     (while alist
       (setq entry (pop alist))
       (when (string-match (car entry) nntp-server-type)
@@ -601,7 +606,7 @@ It will prompt for a password."
            (eval (cadr entry))
          (funcall (cadr entry)))))))
 
-(defun nntp-after-change-function (beg end len)
+(defun nntp-after-change-function-callback (beg end len)
   (when nntp-process-callback
     (save-match-data
       (if (and (= beg (point-min))
@@ -663,7 +668,8 @@ It will prompt for a password."
                nntp-process-wait-for wait-for
                nntp-process-callback callback
                nntp-process-start-point (point-max)
-               after-change-functions (list 'nntp-after-change-function)))
+               after-change-functions 
+               (list 'nntp-after-change-function-callback)))
        t)
        (wait-for 
        (nntp-wait-for process wait-for buffer decode))
@@ -711,7 +717,9 @@ It will prompt for a password."
   (save-excursion
     (set-buffer (or (nntp-find-connection-buffer nntp-server-buffer)
                    nntp-server-buffer))
-    (message "nntp reading%s" (make-string (/ (point-max) 10000) ?.))
+    (let ((len (/ (point-max) 10000)))
+      (unless (zerop len)
+       (message "nntp reading%s" (make-string len ?.))))
     (accept-process-output process 1)))
 
 (defun nntp-accept-response ()
@@ -825,7 +833,7 @@ It will prompt for a password."
                    (zerop (% count nntp-maximum-request)))
            (accept-process-output)
            ;; On some Emacs versions the preceding function has
-           ;; a tendency to change the buffer. Perhaps. It's
+           ;; a tendency to change the buffer.  Perhaps.  It's
            ;; quite difficult to reproduce, because it only
            ;; seems to happen once in a blue moon. 
            (set-buffer buf) 
@@ -880,7 +888,7 @@ It will prompt for a password."
          (save-excursion
            (set-buffer nntp-server-buffer)
            (goto-char (point-min))
-           (and (looking-at "[23]") ; No error message.
+           (and (looking-at "[23]")    ; No error message.
                 ;; We also have to look at the lines.  Some buggy
                 ;; servers give back simple lines with just the
                 ;; article number.  How... helpful.