-;; 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
(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:
(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.")
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.")
(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))
(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)
(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))
(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))))
(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)
(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))
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))
(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 ()
(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)
(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.