Mercurial > hg > xemacs-beta
diff lisp/gnus/nndb.el @ 16:0293115a14e9 r19-15b91
Import from CVS: tag r19-15b91
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:49:20 +0200 |
parents | 376386a54a3c |
children | ec9a17fef872 |
line wrap: on
line diff
--- a/lisp/gnus/nndb.el Mon Aug 13 08:48:43 2007 +0200 +++ b/lisp/gnus/nndb.el Mon Aug 13 08:49:20 2007 +0200 @@ -1,5 +1,5 @@ ;;; nndb.el --- nndb access for Gnus -;; Copyright (C) 1996 Free Software Foundation, Inc. +;; Copyright (C) 1996,97 Free Software Foundation, Inc. ;; Author: Kai Grossjohann <grossjohann@ls6.informatik.uni-dortmund.de> ;; Keywords: news @@ -30,6 +30,9 @@ ;;- ;; Register nndb with known select methods. +(require 'gnus) +(require 'nnmail) + (setq gnus-valid-select-methods (cons '("nndb" mail address respool prompt-address) gnus-valid-select-methods)) @@ -123,7 +126,7 @@ ; get new mail from somewhere -- maybe this is not needed? ; --> todo -(deffoo nndb-request-create-group (group &optional server) +(deffoo nndb-request-create-group (group &optional server args) "Creates a group if it doesn't exist yet." (nntp-send-command "^[23].*\n" "MKGROUP" group)) @@ -132,10 +135,10 @@ (deffoo nndb-request-expire-articles (articles &optional group server force) "Expires ARTICLES from GROUP on SERVER. -If FORCE, delete regardless of exiration date, otherwise use normal +If FORCE, delete regardless of expiration date, otherwise use normal expiry mechanism." (let (msg art) - (nntp-possibly-change-server group server) ;;- + (nntp-possibly-change-group group server) ;;- (while articles (setq art (pop articles)) (nntp-send-command "^\\([23]\\|^423\\).*\n" "DATE" art) @@ -143,9 +146,9 @@ ;; CCC we shouldn't be using the variable nndb-status-string? (if (string-match "^423" (nnheader-get-report 'nndb)) () - (or (string-match "\\([0-9]+\\) \\([0-9]+\\)$" msg) - (error "Not a valid response for DATE command: %s" - msg)) + (unless (string-match "\\([0-9]+\\) \\([0-9]+\\)$" msg) + (error "Not a valid response for DATE command: %s" + msg)) (if (nnmail-expired-article-p group (list (string-to-int @@ -179,18 +182,15 @@ (deffoo nndb-request-accept-article (group server &optional last) "The article in the current buffer is put into GROUP." - (nntp-possibly-change-server group server) ;;- + (nntp-possibly-change-group group server) ;;- (let (art statmsg) (when (nntp-send-command "^[23].*\r?\n" "ACCEPT" group) (nnheader-insert "") (nntp-encode-text) - (nntp-send-region-to-server (point-min) (point-max)) - ;; 1.2a NNTP's post command is buggy. "^M" (\r) is not - ;; appended to end of the status message. - (nntp-wait-for-response "^[23].*\n") + (nntp-send-buffer "^[23].*\n") (setq statmsg (nntp-status-message)) - (or (string-match "^\\([0-9]+\\)" statmsg) - (error "nndb: %s" statmsg)) + (unless (string-match "^\\([0-9]+\\)" statmsg) + (error "nndb: %s" statmsg)) (setq art (substring statmsg (match-beginning 1) (match-end 1))) @@ -205,10 +205,7 @@ (when (nntp-send-command "^[23].*\r?\n" "REPLACE" (int-to-string article)) (nnheader-insert "") (nntp-encode-text) - (nntp-send-region-to-server (point-min) (point-max)) - ;; 1.2a NNTP's post command is buggy. "^M" (\r) is not - ;; appended to end of the status message. - (nntp-wait-for-response "^[23].*\n") + (nntp-send-buffer "^[23].*\n") ; (setq statmsg (nntp-status-message)) ; (or (string-match "^\\([0-9]+\\)" statmsg) ; (error "nndb: %s" statmsg))